Adding Actions to Folder Entities with the Flow DesignerLast Updated: 07/29/2016 Introduced in Verision: 2.0 |
Folder entity actions are actions which can be taken upon a folder entity. Custom folder entity actions are built in flows, and saved within a [MyFolderEntity] folder for the entity type, within a Designer Folder.
Example
In our example, we will add an action to our pre-designed folder entity VehiclePassenger. This action will be called Change Seat Position. Using a form, it will allow us to change the seating position of a passenger while not exposing any other properties of the VehiclePassenger entity to change. The action will be for a single VehiclePassenger entity.
Our example assumes that we have already designed the Change Seat Position Form.
In the resulting New Flow pop-up, give this flow the name “Change Seat Position” and ensure that Base Entity Action Flow is selected as the type. In this example, the entity action is for a single entity. Click OK.
First, we will place the Get VehiclePassenger by Id component in the workspace. In this example, it is in the Flow Designer start-up window, under the category Integrations > All Integrations > Folder Entity Data Structures > VehiclePassenger.
All flows created within an entity action folder will be pre-configured with the Entity ID of the folder entity to which the action applies. To retrieve our car passenger with the Get VehiclePassenger by Id component, we will map EntityId to the Id input. The output will be called “Result”.
Next, we will place in our workspace the form with which we’ll change a VehiclePassenger’s Seat Position property. We will find our pre-designed form in the Toolbox tab, under the category Forms [Interaction] > [Root Folder] > Designer Entities.
To configure this form, we will select it and map the following properties of the Result output to our form’s inputs: FirstName, LastName and SeatPosition.
Next, we will edit our VehiclePassenger to reflect the new seat position that was selected in our form. We will find the Edit VehiclePassenger component in the Toolbox tab, under the category Integration > Folder Entity Data Structures > Vehicle Passenger.
Next, we will map the inputs of the Edit VehiclePassenger component by selecting it and opening the Mapping Editor. First, we will change the mapping type of the Item to Edit input from “Unknown” to “Build Item”. Next, we will map the Seat Position output of our form to the SeatPosition input.
To ensure that all other properties of our VehiclePassenger remain unchanged, we must map the other properties of our VehiclePassenger (Result) to the Edit VehiclePassenger component’s inputs, with three exceptions.
When we edit a folder entity, some fields should not be mapped. For example, the ModifiedDate and ModifiedBy fields are automatically generated, so their mapping types can be left as “Ignore”. The ExtensionData field contains important technical variables which, if changed, may make the folder entity unusable. In this case, we will also leave its mapping type as “Ignore”.
With our mappings complete, we will click OK.
To complete our flow, we will connect the remaining outcomes, save it and close the Flow Designer.
Back in the portal, we will navigate to a Car folder which contains a VehiclePassenger entity.
Our VehiclePassenger – Anthony Young – has a Seat Position of Driver’s Seat. To change this, we will select the new Change Seat Position action.
In the resulting form, we will change Anthony Young’s seat position from Driver’s Seat to Back Seat, and then click Save.
Our VehiclePassenger will be updated with the new seat position, and we will see this in our report of Vehicle Passengers.