How to assign value to choice set field in data service entity using uipath code

Hi team,
I have an excel sheet which has the all the values, I wanted to update excel sheet values into data service. I have created a entity(TestDataService) and fields(Name[Text], Roll No[Text], Age[Text], Sports[DoyouplaySports Choice Set]).
I have created DoyouplaySports in the Entity->Choice set.

my question is how to assign value to choice set, I got an error while assigning, I didn’t find anything related in online.

read the values fromm excel i.e DTResult-> CurrentRow(iterator)
InputReocerd = new DataService.TestDataService()

In the Muti Assign
InputReocerd =CurrentRow(“Name”).toString
InputReocerd =CurrentRow(“Roll No”).toString
InputReocerd =CurrentRow(“Age”).toString
InputReocerd =CurrentRow(“Sports”).toSrting → giving an error here i.e cannot assign a type string to DoyouplaySports

Could you please help me how to convert string to Enum(choice set) type and assign to InputRecord.

my 2nd question how to read Choice set from Studio do we have any activity to read the choice set values.

Hi @Patnala_Tejasri_Cognizant

To Convert String to Choice set.

  • First create a variable with ChoiceSet type .
  • Then Assign .<ChoiceSet Name.Parse(Of .)()

Example I have a Gender Choice Set

I use this assigned variable to assign in InputRecord Field

Hope this helps