Use Case: Showing a Delete Button in a Simple Dashboard

Overview

Sometimes you’ll need more than one action button on your dashboard. For example, one to view a submission and one to delete a submission. You learned how to show a single button in the Simple Dashboard lesson. Let's look at how to add more buttons to your existing dashboard.

In this use case, you'll learn how to create and configure a Delete button. On button-click, the associated Plug-In deletes the submission and removes it from your dashboard.

This use case also includes steps for building a simple dashboard. The dashboard pulls submissions from the following source module: https://trainingx.unqork.io/#/display/5eb01aa6811bf80215fd706b. If you're following along from the Simple Dashboard article, you can skip pre-configuration.

Here's how the completed use case looks in Express View:

Here'show the completed use case looks in the Module Builder:

What You'll Learn

In this article, you'll learn how to:

  • Add a second action button to a simple dashboard.

  • Add and configure a Delete button.

What You'll Need

To build this dashboard, you'll need:

  • 1 Panel component

  • 1 Initializer component

  • 2 Hidden components

  • 2 Plug-In components

  • 1 Decisions component

  • 1 ViewGrid component

Pre-configuration

You'll pre-configure the following components for this use case.

Update the ViewGrid Component

To add your second action button, you'll need to go back into your ViewGrid component.

1. Hover over the gridView ViewGrid component.

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

2. Using the toolbar, click the (Settings) button.
3. Scroll to the bottom of the Display table, and enter the following:

ID

Formula

Heading

Type

CSS

Button

Delete

 

Delete

 

 

Yes (selected)

The ID value here isn't acting as a Property ID, so it doesn't need to be in camel case. The field simply needs a value for the button to work.

4. Click Save.

Configure the Plug-In Component

This is the second Plug-In in this use case. This Plug-In deletes the submission and removes it from your dashboard.

1. Drag and drop a Plug-In component onto your canvas. Place your Plug-In below the submissionId Hidden component.
2. Enter pluginDelete in the Property ID and Label Text fields.
3. Select Manual from the Trigger Type.
4. Enter pluginGetSubmissions in the Post Trigger field.

This triggers pluginGetSubmissions to refresh your dashboard after every deletion.

5. Select Deletes Multiple Module Submissions from the Internal Services drop-down.
6. Enter /fbu/uapi/forms/{{data.moduleId}}/submissions?ids={{data.submissionId}} in the Data Source URL field.

Here, you're adjusting the Data Source URL that populates when you select the Deletes Multiple Module Submissions service. The default value requires that you enter a module ID. The new Data Source URL references the module ID stored in the moduleID Hidden component. It also references single submission IDs, stored in the submissionId Hidden component. Now, clicking your Delete button deletes one specific submission at a time.

7. Select Delete from the Request Type.

8. Click Save.

Update the Decisions Component

Next, you'll update your Decisions component to link your Delete button to the pluginDelete Plug-In component.

1. Hover over the ruleButtons Decisions component.

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

2. Using the toolbar, click the (Settings) button.
3. In the Outputs table, add the following:
a. Property ID: enter pluginDelete.
b. Type: enter trigger.
4. In the Micro Decisions table, add the following:
a. buttonClick: enter Delete.
b. pluginDelete_trigger: enter GO.

5. Click Save.
6. Save your module.

Lab