How to count choice set values in UiPath

We will build UiPath Apps to count the values from a table field that is of type Choice Set.

In this example we will use the count function to do the following:

  • Get the total count of Choice Set values.
  • Get the count of Choice Set fields from a selected row inside a table.

We will first entity in UiPath Data Service with 2 choice set fields.

  1. Choice- It will not accept multiple values
  2. ChoiceMultiple — It accept multiple values

These are the 2 choice sets that we created.

We created an entity “Choices” with fields- Choice & ChoiceMultiple.

Below is the data for each field*

Choice Field contains data — Name1, Name2, Name3

ChoiceMultiple Field contains data — Choice1, Choice 2, Choice 3

  1. In UiPath Apps, add a table and bind the entity to the Data Source property of the table.

  2. Add two labels one below the another.

2.1 Add the following in the Text property of the first label: The total number of values in the Choice set.
2.2 Add the following in the Text property of the second label: The number of values in the selected row.

3.Add two labels next to each other .

3.1 Add the Choices field of the entity using a Count function on the first label.

3.2 Add the Table.entity.SelectedValues field using a Count function on the second label.

Result-

I hope you enjoyed the article!

Happy Automation!!