Tag an Entity via Flow
- Updated on 06 Mar 2019
- 3 minutes to read
A "tag," a short, easily remembered name, can be assigned to entities such as documents, reports, forms, and flows. Users can enter tags when searching for an entity. Assigning the same tags to similar entities allows them to appear together in search results, and to be grouped together on reports. The Tags filter feature in a Designer Projects folder is a helpful way to quickly find entities with a certain tag.
A tag can be added manually or can be added using a flow. When creating a flow to add a tag to an entity, you must know the ID of the entity to add the tag to, and the object's full type from the platform framework.
To add a tag to an entity using a flow, in the Flow Designer , drag an Add Tag component to the work space.
This example will:
- Create a flow that adds a tag to a document.
- Run the flow.
- View the document to see that the tag has been added.
To begin, navigate to a project folder and click the Create Flow button. Name the flow and click OK .
Begin creating the flow by adding two components to the workspace.
From the Flow Designer start-up window, we want to find Fetch by ID step to pass the document that we want to tag to the Add Tag step later. In this particular case, we can tag an entity that exists in user defined type data folder. Here is the path for an existing Entity folder called Vehicle Passenger.In User Defined Types > Entities> VehiclePassenger , select a Fetch By ID component and click Add to add it to the workspace.
From theAll Steps>Integration>Internal Services> TaggingService category, drag anAdd Tag component to the workspace.
Connect the outcome paths in the flow. Connect the Start step to the Fetch ID step, the Fetch ID step to the Add Tag step, then the Add Tag step to the End step.
To define which document will receive the tag from the flow, click the start step and Add New Input Data under Flow Input Data as following.
Next, click Fetch By ID step and map ID under Vehicle Passenger toid .
Select on theAdd Tag step and click the Show Mapping Editor link.
In the Mapping Editor , define the four inputs to theAdd Tag step.
Change the mapping type of the first input,objectID , to FetchByID_Output.ID .
We enter the object's full type in the platform's framework in the objectType Value field.
We enter a short name for the object type in the objectShortType Value field.
Finally, we set tag as constant and enter the tag that will be added to the document when the flow runs in the tag Value field as 'Tagged Through Flow ".
This completes our mapping, so we click OK to save the changes and close the Mapping Editor .
Our flow is also complete, so we save the flow and run it in the Debugger.
Click Debug Flow to access the Debugger.
To see the flow's execution, we click the Diagram tab. The flow completes with no errors. A tag is added to the document designated in the Mapping Editor .
To view the document's tag, we close the Flow Designer and navigate to the folder containing the document. We select it and select Add> Setup> Manage Tags in the lower right.
The tag has been added to the document.