Use Case: Building a Remote Execute Dashboard with a Delete Action

Overview

In this article, you'll learn how to build a remote execute dashboard with a Delete button. Deleting submissions is possible thanks to the Deletes Multiple Module Submissions Unqork service. Remember, it's a best practice to remote execute any API (application programming interface) calls in front-end modules. So, one server-side module will handle getting submissions from your dashboard. Another server-side module will handle deleting submissions from your dashboard. All together, you'll have 4 modules:

# Module Title Description

1

Simple Module for Remote Execute

A simple module where your end-user fills out their personal information. This is the source module for your dashboard. We'll refer to this as Module 1.

2

Remote Execution

Shows the back-end functions, including the module ID used by the remote execute. This module will get submissions to display in your dashboard. We'll refer to this as Module 2.

3

Simple Dashboard with Remote Execute

The dashboard module, where you'll display submission information from Module 1. We'll refer to this as Module 3.

4

Remote Execution for Deleting Submissions This module will handle deleting submissions after your end-user clicks the dashboard's Delete button. We'll refer to this as Module 4.

If you're continuing along from the Use Case: Remote Executing a Dashboard article, your Modules 1 and 2 will stay the same. If you haven't worked through that article, begin with the Pre-Configuration steps below.

Here's how your completed dashboard will work in Express View:

What You'll Learn

In this article, you'll learn how to:

  • Add a Delete button to a dashboard.
  • Use a remote execute to delete submissions from a dashboard.

Update Module 3: Simple Dashboard with Remote Execute

Here you'll make the first round of updates to your Module 3. This is where you'll add the Delete button and supporting components. After creating your Module 4, you'll need to revisit your Module 3 one more time.

To update your dashboard module, you'll need:

  • 1 Hidden component
  • 1 Decisions component
  • 1 Plug-In component

Here's how the updated module looks in the Module Builder:

Update the ViewGrid Component

Here you'll make 2 changes to your ViewGrid:

  • Adding the Delete button.
  • Setting up the Outputs table to export submission IDs. On clicking a particular row's Delete button, that row's submission ID will export to a Hidden component. This way, you can tell the Deletes Multiple Module Submissions API call which submission to remove. For now, you'll use a placeholder Property ID in the Outputs table. In the next step, you'll set up the Hidden component that'll store the submission ID.
1. Hover over the gridDashboard ViewGrid component.

A 5-button toolbar appears above the component on hover-over.

2. Click the (Settings) button to open the Configuration window.
3. In the Outputs table, enter the following:
a. ID: enter exportId.
b. Mapping: enter _id.
4. In the Display table, add the following row:
a. ID: enter Delete.
b. Heading: enter Delete.
c. ButtonYes (checked).

5. Click Save.

Configure the Hidden Component

Here, you'll create a Hidden component to store the submission ID exported by the ViewGrid. Remember to use the same placeholder Property ID you used in the ViewGrid's Outputs table.

1. Drag and drop a Hidden component onto your canvas. Place your Hidden component below your ViewGrid.
2. Enter exportId in the Property ID and Label Text.
3. Click Save.

Configure the Decisions Component

Next, let's set up your Decisions component. This component is what creates an action when your end-user clicks the Delete button. On button-click, the Decisions component will trigger the Plug-In you'll set up next. That Plug-In is what will trigger the remote execute of your Module 4.

1. Drag and drop a Decisions component onto the canvas. Place it below your exportId Hidden component.
2. Enter ruleButton in the Property ID and Label Text.
3. In the Inputs table, enter the following:
a. Property ID: enter buttonClick.
b. Type: enter exact.
c. Required: Yes (checked).
4. In the Outputs table, enter the following:
a. Property ID: enter pluginExecuteDelete.
b. Type: enter trigger.
5. In the Micro Decisions table, enter the following:
a. buttonClick: enter Delete.
b. pluginExecuteDelete_trigger: enter GO.

6. Click Save.

Configure the Plug-In Component

Now for the last component in this module, a Plug-In. This Plug-In will execute your Remote Execution for Deleting Submissions module (Module 4). You'll need to revisit this Plug-In later to finalize the connection. But, let's get it started for now.

1. Drag and drop a Plug-In component onto the canvas. Place it below your Decisions component.
2. Enter pluginExecuteDelete in the Property ID and Label Text.
3. Select Manual from the Trigger Type.
4. Enter pluginExecuteSubmissionsModule in the Post Trigger. This ensures your dashboard refreshes after deleting a submission.
5. In the Inputs table, enter the following:
a. Property ID: enter exportId.
b. Mapping: enter data.ids.
c. Required: Yes (checked).
6. Select Execute Module from the Internal Services drop-down. The Request Type and Data Source URL pre-populate.

7. Click Save.
8. Save your module.

Create Module 4: Remote Execution for Deleting Submissions

Next, let's create your fourth and final module. This module handles deleting submissions from Module 1. On clicking your dashboard's Delete button, the pluginExecuteDelete Plug-In in Module 3 calls on Module 4. This in turn causes an Initializer to fire, which triggers a Plug-In. It's this Plug-In in Module 4 that runs the Deletes Multiple Module Submissions API call. Once deleted, the submission disappears from your dashboard.

For this module, you'll need:

  • 1 API Specificationsnippet
  • 1 Hidden component
  • 1 Initializer component
  • 1 Plug-In component

Here's how the completed module looks in the Module Builder:

Turning on Server-Side Execute

Before adding components to your Module 4, you'll adjust the module settings. By setting your module to server-side execute, your module becomes inaccessible to anyone without Module Builder access.

1. Click the Settings button on the left side of the Module Builder.
2. Set the Server Side Execution Only toggle to ON.

3. Click Save Settings.

Add the API Specification Snippet

Let's return to the Module Builder and start configuring the module. Here, you'll use the Unqork API Specification snippet. Using this snippet is a best practice when creating remote execute or API modules.

1. In the left sidebar of the Module Builder, click the Snippets button.
2. Enter API Specification in the search bar.
3. Drag and drop the API Specification snippet onto your canvas.

For the API Specification snippet to work properly, you'll need to move the panelInfo, panelRequest, panelConfig, and panelResponse Panels outside of the panelApiTemplate Panel. Then, you'll delete the empty panelApiTemplate Panel component.

4. Hover over the panelInfo Panel component.
5. Click and drag the (Move) button, dropping the panelInfo Panel outside of the panelApiTemplate Panel.
6. Repeat for the panelRequest, panelConfig, and panelResponse Panels.
7. Hover over the empty panelApiTemplate Panel component.
8. Click the (Remove) button.

Update the panelInfo Panel

Next, let's make some updates to the components in the panelInfo Panel. This information says what the purpose of this remote execute, or API, module is.

Update the description HTML Element Component

1. Hover over the description HTML Element component.
2. Click the (Settings) button to open the Configuration window.
3. In the Content field, replace the default text with the following: This module is to host the Deletes Multiple Module Submissions call that is used to delete module submissions on the dashboard.
4. Click Save.

Update the method Hidden Component

1. Hover over the method Hidden component.
2. Click the (Settings) button to open the Configuration window.
3. In the Default Value field, replace the default text with the following: DELETE
4. Click Save.

Update the panelRequest Panel

Next, let's set up the panelRequest Panel. Components added to this Panel are part of the API request. That is, they house the values the Plug-In will use when running the Deletes Multiple Module Submissions API call. Here, you'll only need a single Hidden component. You'll notice a default requestParameter Hidden component included in the snippet. But let's delete that for now and configure our own. That way, you won't have to update its pre-configured settings.

Remove the requestParameter Hidden Component

1. Hover over the requestParameter Hidden component.
2. Click the (Remove) button.

Configure the Hidden Component

1. Drag and drop a Hidden component onto your canvas, placing it inside the panelRequest Panel.
2. Enter ids in the Property ID and Label Text.
3. Click Save.

Update the panelConfig Panel

Now, let's update the panelConfig Panel. This Panel is where you'll add all the components involved in making your module work. In this case, you'll add an Initializer and a Plug-In.

Configure the Initializer component

Let's set up your Initializer. This Initializer will trigger the pluginDeleteSubmissions Plug-In you'll set up next. One key step is using a Trigger Type of New Submission. This way, the Initializer runs whenever the pluginExecuteDelete Plug-In in your Module 3 calls your Module 4.

1. Drag and drop an Initializer component onto your canvas, placing it inside the panelConfig Panel.
2. Enter initExecuteDeleteSubmissions in the Property ID and Label Text.
3. Select New Submission from the Trigger Type.
4. In the Outputs table, enter the following:
a. Property ID: enter pluginDeleteSubmissions.
b. Type: enter trigger.
c. Value: enter GO.

5. Click Save.

Configure the Plug-In component

The last step in configuring this module is setting up your Plug-In. This Plug-In is what deletes submissions from your Simple Module for Remote Execute (Module 1). So, you'll need to have that module's module ID handy to complete the configuration.

1. Drag and drop a Plug-In component onto the canvas, placing it inside the panelConfig Panel.
2. Enter pluginDeleteSubmissions in the Property ID and Label Text.
3. Select Manual from the Trigger Type.
4. In the Inputs table, enter the following:
a. Property ID: enter ids.
b. Mapping: enter ids.
c. Required: Yes (checked).
5. Select Deletes Multiple Module Submissions from the Internal Services drop-down. The Request Type and Data Source URL pre-populate.
6. In the Data Source URL, replace {moduleId} with 5f8d9eb9f1a98d024e984c75.

This is the module ID of our Simple Module for Remote Execute (Module 1). It's drawn from the source module's hyperlink as follows: https://training.unqork.io/#/form/5f8d9eb9f1a98d024e984c75/edit.

If you created your own Module 1, enter your module's unique module ID instead.

7. Click Save.
8. Save your module.

Update Module 3: Simple Dashboard with Remote Execute

Now for the last step of the configuration. This final link lets your dashboard's Delete button actually delete a submission. You'll need to enter the module ID of your Module 4 in the pluginExecuteDelete Plug-In. So, revisit your Module 4 and copy the module ID.

Update the Plug-In component

1. Hover over the pluginExecuteDelete Plug-In component.
2. Click the (Settings) button to open the Configuration window.
3. In the Data Source URL, replace {moduleId} with 5f90843a7bfe8d023c981142.

This is the module ID of our Remote Execution for Deleting Submissions module (Module 4). It's drawn from the module's hyperlink as follows: https://training.unqork.io/#/form/5f90843a7bfe8d023c981142/edit . If you created your own Module 4, be sure to enter your module's unique module ID instead.

4. Click Save.
5. Save your module.

Lab

You'll find the completed Remote Execute Dashboard with Delete Action use case modules below: