apps
latest
false
UiPath logo, featuring letters U and I in white
Apps User Guide
Automation CloudAutomation Cloud Public SectorAutomation Suite
Last updated Jun 17, 2024

Legacy versus VB expressions

This section lists the common use cases for binding app elements, and how you can achieve the binding using legacy and VB expressions.

Using static string URLs in Image controls

Legacy

VB

  1. Add the Image control.

  2. Set the URL/Value binding property to https://path/to/the/image_file.jpg
Note:

Base64 images are also supported.

  1. Add the Image control.

  2. Set the Source property to new AppsFile("https://path/to/the/image_file.jpg")
Note:

Base64 images are also supported.

Using the File field of an entity in Image controls

Legacy

VB

  1. In your app, reference the entity that holds the desired file.

  2. Bind the entity to a Table control.

  3. Add the Image control.

  4. Set the URL/Value binding property to the file.

docs image
  1. In your app, reference the entity that holds the desired file.

  2. Bind the entity to a Table control.

  3. Add the Image control.

  4. Set the Source property to MainPage.Table.SelectedItem.FileColumn

Using files from a Storage Bucket in Image controls

Legacy

VB

  1. In your app, reference the storage bucket that holds the desired file.

  2. Create an app variable of type AppsFile. For example fileVar.
  3. Add the Download file from Storage Bucket rule.

  4. Assign the downloaded file to the previously created app variable (fileVar).
  5. Add the Image control.

  6. Set the URL/Value binding property to fileVar.
  1. In your app, reference the storage bucket that holds the desired file.

  2. Create an app variable of type AppsFile. For example fileVar.
  3. Add the Download file from Storage Bucket rule.

  4. Assign the downloaded file to the previously created app variable (fileVar).
  5. Add the Image control.

  6. Set the Source property to fileVar.

Using choice sets to populate List controls

Legacy

VB

  1. In your app, reference the entity with the choice set.

  2. Add the List control.

  3. Set the List source property to GetChoiceSet("entity_name").
  4. Set the Column property to the choice set name.

Read this procedure for more information.

Referencing a choice set bound to List controls

Legacy

VB

<PAGE_NAME>.<CONTROL_NAME>.SelectedItem.<COLUMN_NAME><PAGE_NAME>.<CONTROL_NAME>.SelectedItem.<COLUMN_NAME>

Setting a single select choice set as the default value for controls

Dropdown, Radio Button and List controls support single select choice sets.

Legacy

VB

docs image
MainPage.Dropdown.DataSource.data.Select(Function(x) x.NumberId).ToList(0)MainPage.Dropdown.DataSource.data.Select(Function(x) x.NumberId).ToList(0)

Setting a multiselect choice sets as the default value for controls

Multiselect Dropdown controls support multiselect choice sets.

Legacy

VB

docs image
<PAGE_NAME>.<MULTISELECT_CONTROL_NAME>.DataSource.data.Where(Function(x) <VARIABLENAME>.<ENTITY_FIELD_OF_TYPE_CS>.contains(x.NumberId)).toList()<PAGE_NAME>.<MULTISELECT_CONTROL_NAME>.DataSource.data.Where(Function(x) <VARIABLENAME>.<ENTITY_FIELD_OF_TYPE_CS>.contains(x.NumberId)).toList()
Note:
To use this expression, ensure the entity variable is set to selectedItem using a Set Value rule.

Using static strings to populate List controls

Legacy

VB

=["Value1", "Value2", "Value3"]=["Value1", "Value2", "Value3"]
AppsDataSource.from({"Value1", "Value2", "Value3"})AppsDataSource.from({"Value1", "Value2", "Value3"})

Bind a date to Date Picker controls

Legacy

VB

To bind todays date, set the Default Date property to =Now()
To bind todays date, set the Default Date property to DateOnly.FromDateTime(Now)
To bind a specific date, for example 5th May 2021, set the Default Date property to 2021-01-05
To bind a specific date, for example 5th May 2021, set the Default Date property to new DateOnly(2021,1,25)

Using an entity Date-Time field in Date Picker controls

Legacy

VB

Bind the required entity field to the Date Picker control.

DateOnly.FromDateTime(customerEntityVar.DOB.Value.Date)DateOnly.FromDateTime(customerEntityVar.DOB.Value.Date)

Computing the difference between two Date Picker values

Legacy

VB

N/A

MainPage.Datepicker1.Value.Value.DayNumber - MainPage.Datepicker.Value.Value.DayNumberMainPage.Datepicker1.Value.Value.DayNumber - MainPage.Datepicker.Value.Value.DayNumber

Referencing errors

You can reference the errors from the following rules:

  • Start Process

  • Entity rules

  • Queue rules

  • Trigger Workflow rule

Legacy

VB

In VB expressions, errors are exposed in the rule output. Reference an error as follows:
<PAGENAME>.<RULENAME>.Error.Message<PAGENAME>.<RULENAME>.Error.Message
<PAGENAME>.<CONTROLNAME>.<RULENAME>.Error.Message<PAGENAME>.<CONTROLNAME>.<RULENAME>.Error.Message
docs image

Was this page helpful?

Get The Help You Need
Learning RPA - Automation Courses
UiPath Community Forum
Uipath Logo White
Trust and Security
© 2005-2024 UiPath. All rights reserved.