
Announcements
Greetings, all. I am trying to dynamically set a Dataverse Choice column but cannot figure out a simple way to get the value for a specific Dataverse Choice. Does anyone know how to look up a specific choice's integer value?
Hi @arpost , Microsoft Dataverse stores choice columns and their values in the "String Maps" table. To get the "Value" of Dataverse Choice Column dynamically, you need to add few more actions in the power automate flow. Here are the details:
I created a sample Dataverse table named as "Test Table" and created a choice type column with name "Community" and this choice is synced with a Global Choice named as "Community Type".
In my example,
Table Name = Test Table (hd_testtable)
Column Name (Choice)= Community (hd_community)
Global Choice Name = Community Type (hd_communitytype)
If I want the Integer value of the Choice "Power Automate". To get this below are the configuration of the flow:
Now, In power automate flow, Add a Dataverse "List rows" action with following input parameters:
Table name: String Maps
Select columns: value, attributevalue (Optional - To get only selected columns.)
Filter rows: objecttypecode eq 'YourTableName' and attributename eq 'YourChoiceColumnName'
//Filter Array:
Add a filter array to Filter Specific Choice based on their Name (Label). Add the required input parameters as given in the image below.
From: outputs('List_rows')?['body/value']
item()?['value'] is equals to YourChoiceLabel
//Compose:
Add a compose action to see the integer (Value) of the Choice.
first(body('Filter_array'))?['attributevalue']
As we passed the Label as Power Automate in the "Filter Array" so as output we received 999990001. See the attached image:
Please try this at you end and let me know if you face any issues.
-----------------------------------------------------------------------------------------------------------------
If your question got an answer, please click "Accept as Solution "✅, If you liked my answer, please hit the "thumbs-up" 👍button.
Thank you,
Harsh Deol