The Provided Value For Field [xxx] Is Not Of Decimal Format, TraceId: xxx

How to Query Entity Records on Choice Set Fields in order to not receive the error " The provided value for field [xxx] is not of decimal format, TraceId: xxx"?

Prerequisites

  • Data Service feature
  • UiPath.DataService.Activities.23.10.0 dependency
  • UiPath Studio 2023.4.5 with C# language support


Issue Description

Trying to query records based on a field that is populated from a choice set.
However, it is not possible to query based on choice set value (text field) as an error that query value needs to be in decimal format is thrown.

Example:

Root Cause

Query by the index of the string that is present in the choice set, not by the choice set string value.

Resolution

Approach #1

  1. Create a new variable that will hold the Choice set index.

  1. Set it to System.Decimal in Variables panel

  1. In the Query Entity Records activity, in the Filter Builder provide the freshly created variable as String.

Results:

Approach #2

Query by specifying the index of the choice set field as string.

Example:

Results: