Adding Actions to Folder Extensions
  • Updated on 18 Mar 2019
  • 3 minutes to read
  • Print
  • Dark
    Light

Adding Actions to Folder Extensions

  • Print
  • Dark
    Light

OVERVIEW

Folder Extension Actions are any actions that can be added on aFolder of that Folder Extension Type.

To create a new Folder Extension Action in the designer studio, navigate to the Configuration Folder generated for the data structure, and select the Add Action button. Create User Action, this action adds data to the existing entity.

Note
The Folder Extension used in this example was created in this document: Folder Extension Data Structures

2019-03-18_130014.png

To add actions navigate to the Configuration folder. Any flow added in this type of folder will create an Action available for use on that Folder Extension. It is possible to create multiple Folder Action Folders and in some cases, it is recommended.

Reasons to create more than one Action folder are:

  • To better organize by functionality
  • To apply security by restricting users to see only folder actions relevant to them. For example, restricting the ability to edit a form or granting permission.

The created Action will now be available, making it possible to edit the form details. On submission, the folder will be updated with the details entered. This example also assumes that the form that we will use "Edit Vehicle Form" has already been created.

2019-03-18_144726.png

Example

Begin in the studio by navigating to the Configuration Folder that was created when the Folder Extension was created located in the Designer Folder. Select User Actions and then Create User Action form the action panel located at the bottom of the page and choose the Create Add Entity Action button. This action adds a new form with new information.

2019-03-18_131301.png

In the resulting Create User Action dialog, name the action "Edit Vehicle" and select CREATE to open it in the Flow Designer.

2019-03-18_150104.png

To be able to edit the folder through an action, the flow must first get the folder using the Get Vehicle step.
The Get Vehicle step is available in the step catalog, under the category User Defined Types > Folder Extensions > Vehicle.

2019-03-18_150205.png

As a folder extension action, the flow is already configured with an input called FolderId. This is the ID of the folder where the action is occurring.

Map FolderId to the Id input of the Get Vehicle component. Rename the output result of the Get Vehicle component to "Vehicle".

2019-03-18_150412.png



Expand the Forms [Interaction] > [Parent Folder] category of the Toolbox panel and drag Edit Vehicle Form to the work space.
Next, select the Edit Vehicle Form step and map the properties of the Vehicle folder we retrieved earlier to the inputs of the form.

2019-03-18_150737.png

Perform the actual editing of the folder with the Edit Vehicle step. Find it in the Toolbox panel, under the category User Defined Types > Folder Extensions > Vehicle. Map the inputs that are necessary for the Edit Vehicle component to work.

Begin by mapping FolderId directly to FolderId. To edit the additional properties of the folder, change the mapping of Extension Data from "Unknown" to "Build Data."

Next, map the outputs from the form to their respective properties in the Vehicle to edit. Change the mapping type of Entity TypeName from "Ignore" to "Null". Not changing this mapping will generate a fatal error in the flow.

2019-03-18_151407.png

When editting the folder, name the folder to reflect the updated properties as they have been set in the form. To do this, change the mapping type of FolderName to Text Merge HTML and, in the Text Merge Editor, define a name that includes the vehicle's year, make and model.

2019-03-18_151627.png

This completes the flow, save it and close the Flow Designer.

2019-03-18_154521.png

Now navigate to the vehicle folder and right click to see the newly created Action. In this example, the action is named,Edit Vehicle.
When selecting this action a form that is pre-populated with the properties of this Vehicle folder will appear.

In this example, the vehicle was originally defined as a silver 2009 Honda Civic. Using this form redefine this vehicle as a blue 2019 Jeep Wrangler and then select save.

2019-03-18_162237.png

When the studio is updated, see that the folder details have been updated and the folder name has changed.

2019-03-18_162517.png

Was this article helpful?