Subscribe

UiPath Apps

The UiPath Apps Guide

Work with Data Source and Value Bind

Background information


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.

Example


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

Building the workflow


The first step of this example is building the workflow in UiPath Studio. This is a simple workflow, consisting of a few arguments.

  1. Open Studio and create a new Process.
  2. Create the following arguments:
Argument nameDirectionArgument typeDefault value
out_DataTableOutDataTable-
in_SelectedItemsInDataTablenew DataDable
filtered_SelectedItemsOutDataTable-
  1. Drag a Sequence to the Workflow Designer.
  2. 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:
486486
  1. 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 in the table below.
ThenElse
1. Drag a Sequence inside the Then container.
2. Add an Assign activity inside the Sequence container.
Add filtered_SelectedItems in the To field.
Add (from r In in_SelectedItems.Select() Where r("Selected").Equals(true) Select r).CopyToDataTable in the Value field.
3. Add a Log Message activity below the Assign activity.
Set LogLevel to Info.
Add filtered_SelectedItems.ToString in the Message field.
1. Drag a Sequence inside the Else container.
2. Add a Log Message activity below the Assign activity.
Set LogLevel to Info.
Add "First run or empty" in the Message field.

Result

In the end, the workflow should look as the one in the figure below.

11111111

🚧

Important:

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:

  1. 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.
  2. 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.

Building the app


After publishing the workflow build during the Building the workflow procedure to your Orchestrator, it's time to build the app itself.

  1. Create a new app.
  2. Reference the process built above. For more information on how to reference a process, see Referencing a Process from Orchestrator.
  3. Add one Custom List control and one Table control to your app, next to each other.
  4. In the Data source field of the table, add Out: out_DataTable from the process.
690690
  1. Add a Checkbox control and a Textbox control to the custom list and configure them as follows:

    • Add the Out: Item item from the Out: out_DataTable section of the process in the Label field of the checkbox control.
    • Add the Out: Selected item from the Out: out_DataTable section of the process in the Value binding field of the checkbox control.
    • Add the Out: Quantity item from the Out: out_DataTable section of the process in the Value binding field of the textbox control.
  2. 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 and Out.out_DataTable in the Input Override field.
452452
  1. Add a container below the button.
  2. Add two Label controls next to each other.
    • Add the filtered_SelectedItems.Item item from the Out: filtered_SelectedItems section of the process in the Text field of the first label.
      • Add the filtered_SelectedItems.Quantity item from the Out: filtered_SelectedItems section of the process in the Text field of the first label.

Conclusion


When previewing the app, you will be able to select items in a custom list that comes from a process.

776776

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.

Updated 2 months ago

Work with Data Source and Value Bind


Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.