In Workflow Studio, we use binding to pass data from one activity to another. Binding can be achieved in two ways: one way is to use the Binding Mapper, and the other is by writing custom C# code in the activities.
Bindings allow you to drag and drop properties from one activity to another using a built-in property mapper or binding mapper. Bindings are bi-directional.
In order to demonstrate how binding works I will create a Workflow and will put one Lookup control and one Form on it. My lookup control will display the list of people in EmpowerID and based on the selected record from the lookup control I will pass that user information on to my Form and my Form will display the selected user information.
Our focus during this demonstration will be on understanding how Binding works in Workflow Studio, rather than delving into the creation of Forms and Lookup Controls. If you're interested in learning about the creation of lookup controls, please refer to the previous topic. Similarly, if you're keen on exploring Forms, you can proceed to our upcoming topic dedicated to Forms.
Let's consider a Workflow where we incorporate a single-select lookup control, allowing the selection of only one record at a time. Additionally, there is a form within the workflow, featuring several common fields. Below, you'll find images showing how the lookup control and form appear in both Workflow Studio and EmpowerID Web UI for your reference.
Now let's see how these two components are placed within a Workflow and what they look like. Please refer to the image below
Now that we have our workflow ready, featuring a Lookup Control and a Form Control placed within it, it's time to pass the selected user's data from the lookup control to our Form. To accomplish this, let's navigate to the Bindings tab. Here, you'll encounter two identical columns. On the left-hand side, expand the tree control for our lookup. Then, further expand its Output node and select the SelectedValueAsComponent property. Next, drag and drop it onto the right-hand side column. As you expand the tree control for the Form on the right-hand side, delve into its Input/Output node. There, drop your SelectedValueAsComponent Property onto the TargetPerson (this is the custom name assigned to our Person Rbac component on our Form; you could have chosen any name here)