Adding Actions to Folder Extensions

Last Updated: 01/23/2019 Introduced in Version: 2.0

OVERVIEW

Folder Extension Actions are any actions that can be added on a Folder 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. 

There are two types of Actions shown in this example that are created. 

  1. Create User Action, this action adds data to the existing for.
  2. Create Add Entity Action, this action adds a new form with new information.

 

Example

Already created for this example “Edit vehicle” Form.

 

Start by creating a Folder Extension. Select Create Datatypes/Integration then select Folder Extension.

Name this Folder Extension, Vehicle, with the fields Color, Make, Model, and Year. Select Save.

 
 
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, our folder will be updated with the details we’ve entered. This example also assumes that the form that we will use “Edit Vehicle Form” has already been created.
 
 
 
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 Add Entity 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. 
 
 
 
 
 

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

 

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.

 

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.

Next, rename the output “Result” of the Get Vehicle component to “Vehicle”.

 

 
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 our form.

 

Next, perform the actual editing of our folder with the Edit Vehicle step. We will find it in the Toolbox panel, under the category User Defined Types> Folder Extensions > Vehicle.

Next, 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 our folder, change the mapping of Extension Data from “Unknown” to “Build Data.”

Next, map the outputs from our form to their respective properties in the Vehicle that we would like to edit. We will also be sure to change the mapping type of EntityTypeName from “Ignore” to “Null”. Not changing this mapping will generate a fatal error in our flow.

 

When we edit our folder, we would like the name of our folder to reflect the updated properties as we’ve set them in our form. To do this, we will change the mapping type of FolderName to Text Merge HTML and, in the Text Merge Editor, define a name that includes our vehicle’s year, make and model.

 

 

This completes our flow, so we will save it and close the Flow Designer.

 

Now, when we navigate to the vehicle folder and right click to see the newly created Action. In this example, the action is named, Edit Vehicle Action. 

When we select this action, we will be shown a form that is pre-populated with the properties of this Vehicle folder. In this example, our vehicle was originally defined as a blue 2011 Honda Civic. Using this form, we will redefine this vehicle as a blue, Subaru, Crosstrek, 2018 and then select save. 

 

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

 

Additional Resources