Updating Dataverse Optionset / Choice from Text dynamically using Power Automate

Rehan Memon
2 min readMar 22, 2023

--

To dynamically set a Choice value in a Dataverse entity from Power Automate Flow, you can retrieve the attribute value (long number) instead of the label by performing the following steps:

Obtain the entity name and the name of the Choice / Option set.

Use the “List Rows” action on the “String Maps” entity to retrieve the mapping between the label and the corresponding attribute value.

Filter the results to only include the rows where the “Object Type Code” matches the entity code and the “Attribute Name” matches the Choice / Option set name.

The filter rows here is :

objecttypecode eq ‘rl_productreturn’ and attributename eq ‘rl_itrmtype’

where rl_productreturn is the entity and rl_itrmtype is the Choice name.

This will Generate an array and next step is to apply filtering to it

where the From is: outputs(‘List_Rows’)?[‘body/value’]

and the lower Value is: item()?[‘value’]

and the Outputs is the label text value for the Choice.

Then, the attribute value required to update a record (choose custom in the choice drop down) is:

first(body(‘Filter_array’))?[‘AttributeValue’]

Thank you for reading and we hope this blog post was helpful. Stay tuned for more Power Automate tips and tricks!

If you found this useful and would like to connect ! Please feel free to reach out via LinkedIn | Email

--

--

No responses yet