- Getting Started
- Before You Begin
- How To
- Build Your First App
- Build a Mobile-friendly App
- Embed Apps
- Embed Maps
- General User Experience Guidelines
- Hide Containers Using a Button
- Include Excel Charts in Apps
- Include MailTo Links
- Include Star Ratings
- Use Count With Choice Set Values
- Use Document Viewer
- Use Master Detail View
- Use Selected Values From a Table
- Use the Send Interim Result Activity
- Set External Context
- Work With Data Source and Value Bind
- Notifications
- Designing your App
- Events and Rules
- Rule: If-Then-Else
- Rule: Open a Page
- Rule: Open URL
- Rule: Close Pop-Over/Bottom Sheet
- Rule: Show Message
- Rule: Show/Hide Spinner
- Rule: Set Values
- Rule: Start Process
- Rule: Upload File to Storage Bucket
- Rule: Get File From Storage Bucket
- Rule: Reset Values
- Rule: Create/Update Entity Record
- Rule: Delete Entity Record
- Rule: Add to Queue
- Function: And, Or, Not
- Function: Concat
- Function: Contains
- Function: Count
- Function: EndsWith
- Function: If
- Function: IsBlank
- Function: Guid
- Function: Length
- Function: List
- Function: StartsWith
- Function: Sum
- Function: Sort
- Function: Now
- Function: Today
- Function: Time
- Function: Year
- Function: Month
- Function: Day
- Function: Hour
- Function: Minute
- Function: New
- Function: Lookup
- Function: Filter
- Leveraging RPA in your App
- Leveraging Entities in Your App
- Leveraging Queues in Your App
- Application Lifecycle Management (ALM)
- Basic Troubleshooting Guide
Work With Data Source and Value Bind
Data Source and Value Bind fields of a control are two-way bound, meaning they can both update the root data that is bound to that control.
To better understand this, we can use a simple example. You can try adding a label and a textbox to an app, then create an app variable. Assign the Value binding property of the textbox control and the Text property of the label control to the variable. When previewing the app, notice that when you change the value of your textbox, the app variable is updated as well. On the other hand, the Text property is a one-way bound field, only displaying data that cannot be updated.
In this example we will build an app where the user can select multiple items from a custom list that comes from a process.
For this example we will build the following:
- An automation process
- An app using UiPath Apps
The first step of this example is building the workflow in UiPath Studio. This is a simple workflow, consisting of a few arguments.
- Open Studio and create a new Process.
-
Create the following arguments:
Argument name
Direction
Argument type
Default value
out_DataTable
Out
DataTable
-
in_SelectedItems
In
DataTable
new DataDable
filtered_SelectedItems
Out
DataTable
-
- Drag a Sequence to the Workflow Designer.
-
Add a Build Data Table activity inside the Sequence container.
- Add the
out_DataTable
argument in the DataTable field. - Add a column named Selected.
-
Configure the table as in the figure below:
- Add the
-
Add an If activity below the Build Data Table activity and follow the steps below to configure it.
- Add
in_SelectedItems.Rows.Count > 0
in the Condition field. -
Configure Then and Else as displayed below.
Then
1. Drag a Sequence inside the Then container.
2. Add an Assign activity inside the Sequence container.
- Add filtered_SelectedItems in the To field.
3. Add a Log Message activity below the Assign activity.- Add (from r In in_SelectedItems.Select() Where r("Selected").Equals(true) Select r).CopyToDataTable in the Value field.
- Set LogLevel toInfo
.- Addfiltered_SelectedItems.ToString
in the Message field.Else
1. Drag a Sequence inside the Else container.
2. Add a Log Message activity below the Assign activity.
- Set LogLevel toInfo
.- Add"First run or empty"
in the Message field.
- Add
Result
In the end, the workflow should look as the one in the figure below.
If your process is making use of a complex .NET object in its input or output (eg DataTable), App Studio doesn't know what the fields of that object are by default. There are two ways you can specify this:
- Run your process before adding it to your app. If a process uses an object, Apps will check its Job History to automatically detect the schema/fields of that object.
- Manually specify object fields for process input/output. If your process has no job history then after it has been added to your app you must manually specify its fields in order to use them in your app.
Manually added parameters to a process will be removed if the process is refreshed.
After publishing the workflow build during the Building the workflow procedure to your Orchestrator, it's time to build the app itself.
- Create a new app.
- Reference the process built above.
- Add one Custom List control and one Table control to your app, next to each other.
- In the Data source field of the table, add
Out: out_DataTable
from the process.
- Add a Checkbox control and a
Textbox control to the custom list and configure them as follows:
- Add the
Out: Item
item from theOut: out_DataTable
section of the process in the Label field of the checkbox control. - Add the
Out: Selected
item from theOut: out_DataTable
section of the process in the Value binding field of the checkbox control. - Add the
Out: Quantity
item from theOut: out_DataTable
section of the process in the Value binding field of the textbox control.
- Add the
- Add a Button control and name it
Run
. Configure the Clicked on rule as follows:- Add a Start process rule.
- Add a name in the Job name field and mark it as Attended.
- Add
in_SelectedItems
andOut.out_DataTable
in the Input Override field.
- Add a container below the button.
- Add two Label controls next to each
other.
- Add the
filtered_SelectedItems.Item
item from theOut: filtered_SelectedItems
section of the process in the Text field of the first label.- Add the
filtered_SelectedItems.Quantity
item from theOut: filtered_SelectedItems
section of the process in the Text field of the first label.
- Add the
- Add the
When previewing the app, you will be able to select items in a custom list that comes from a process.
The key of this example is to better understand the difference between Data Source, Value Bind, and input:
- Data Source and Value Bind are two-way bound. This means that they can both update the root data that is bound to a control.
- Input override allows you to pass in objects from other sources, such as a data table from a process, or an entity from Data Service.