cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Cdgf
Frequent Visitor

Populating Dynamics 365 optionset with label

I have not been able to find anything related to this specific issue, only how to retrieve an optionset label. However, is there a way to populate an optionset field based on a string value?

 

I am currently trying to retrieve values from an SQL table and map them to the account entity in Dynamics 365. At the moment, I am having trouble with the optionset fields in D365, as they expect an integer, but I only have the label (which are identical to the optionset labels). 

 

I know that a switch or conditions can be used, but there are way too many options to make this feasible. 

 

Is it somehow possible to populate the field from the label, or do I absolutely need the optionset value/id?

1 ACCEPTED SOLUTION

Accepted Solutions
Mira_Ghaly
Dual Super User II
Dual Super User II

@Cdgf

What I suggest to you is to query the metadata to get the optionset value!/ label pair and place in an array.

In the below blog post you can see how you can achieve this:

https://debajmecrm.com/how-to-query-metadata-in-dataverse-common-data-service-using-power-automate/

 

Then you need to use the label from your sql to get the optionset value from the array and pass it as custom value. 

 

Hope this gives you an idea!

 

If this post helps you with your problem, please mark your as Accepted solution.If you like my response, please give it a Thumbs Up.

Blog: here

View solution in original post

2 REPLIES 2
Mira_Ghaly
Dual Super User II
Dual Super User II

@Cdgf

What I suggest to you is to query the metadata to get the optionset value!/ label pair and place in an array.

In the below blog post you can see how you can achieve this:

https://debajmecrm.com/how-to-query-metadata-in-dataverse-common-data-service-using-power-automate/

 

Then you need to use the label from your sql to get the optionset value from the array and pass it as custom value. 

 

Hope this gives you an idea!

 

If this post helps you with your problem, please mark your as Accepted solution.If you like my response, please give it a Thumbs Up.

Blog: here

View solution in original post

Cdgf
Frequent Visitor

Thank you, something like this I was looking for!

Helpful resources

Announcements
MPA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Users online (1,529)