cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Shannon
Advocate IV
Advocate IV

How to get option set text instead of value from Dynamics 365

I am connecting to Dynamics 365, and want to have a condition that checks if an Option Set value is equal to "Yes". In CRM though, option sets have values like 3000758, which is what comes through in Flow. How can I get the text of an option set field? Do I have to use the int value of the option set field?

2 ACCEPTED SOLUTIONS

Accepted Solutions
abm
Super User
Super User

Hi @Shannon,

 

You won't be able to get the text value of the optionset from flow. Can you please explain why you need to check the text values?

 

Thanks



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog
Power Automate Video Tutorials

View solution in original post

Sorry, due to the volume of times this has run, I cannot find examples of when it was working. After researching this further, I have come to the conclusion that I must have been using the original CDS connector at some point in time instead of the CDS (current environment) connector. I used a Switch action to convert my option set ID into a string in a variable and that works for me.

View solution in original post

13 REPLIES 13
abm
Super User
Super User

Hi @Shannon,

 

You won't be able to get the text value of the optionset from flow. Can you please explain why you need to check the text values?

 

Thanks



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog
Power Automate Video Tutorials

Just figured it would make the Flow look a little more intuitive, rather than having to check back at what a number is equivalent to.

Hi @Shannon,

 

You can add comments in your flow templates. I would prefer to check via number than a hardcoded text. If the text changes then there are depencies like flow and others to change which won't be a good design in my opinion.

 

Thanks



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog
Power Automate Video Tutorials

We sometimes use the dynamics content in a triggered email. So for we want the text value to display in the email instead of 1000000001.

@hazems another good point on why this would be useful. I can see arguments both ways on why we should/shouldn't be able to do this, but I think it the user should be able to use their discretion on whether or not to pull text vs. value.

 

I've created an Idea post, where you can upvote this if you'd like.

I agree with @Shannon and have voted for this feature.  I need to show the text rather than the numeric value in an email.   The numeric value means nothing to the email recipient.

Shaboo992
Frequent Visitor

Hi Azems,

 

Easy solution!

 

Found the easy solution add a label to the suffix to the field attribute schema name.

 

Example: Field attribute "ab_accountype" replace with "_ab_accounttype_label"

 

Which works for me.

 

Thank you

j_machale
Regular Visitor

We also want to read a record and send an email, one of the values is an option set but it looks like currently we can't read the text value - the numbers are meaningless so looks like we would have to hardcode them in in the flow and use a switch statement as this is the only workaround I have seen.

Adding an "_value" (see post above from Shaboo992) worked for me...until yesterday. Now it no longer works. All I get is the value now. We need the text label for an integration we have with Sharepoint.

Hi @NelsonJohnson 

 

Could you please post your run time history values where it retrieves the option set value?



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog
Power Automate Video Tutorials

Sorry, due to the volume of times this has run, I cannot find examples of when it was working. After researching this further, I have come to the conclusion that I must have been using the original CDS connector at some point in time instead of the CDS (current environment) connector. I used a Switch action to convert my option set ID into a string in a variable and that works for me.

IronArm
Regular Visitor

Yes you can.  I'm not sure about in 2017, but this can be done now.

Insert the Dynamic Content (which will give you the value)

Copy that Dynamic Content to a text editor.

You'll have something like:
@{outputs('Get_a_row_by_ID')?['body/field_name']}
Change that to:

outputs('Get_a_row_by_ID')?['body/field_name@OData.Community.Display.V1.FormattedValue']

Be sure to remove the "@" at the beginning and the braces.
Now delete the Dynamic Content and insert the line above as an expression. 

 

To get the text instead of the value:
Insert the Dynamic Content (which will give you the value)

Copy that Dynamic Content to a text editor.

You'll have something like:
@{outputs('Get_a_row_by_ID')?['body/field_name']}
Change that to:

outputs('Get_a_row_by_ID')?['body/field_name@OData.Community.Display.V1.FormattedValue']

Be sure to remove the "@" at the beginning and the braces.
Now delete the Dynamic Content and insert the line above as an expression. 

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

Carousel_PP_768x460_Wave2 (1).png

2022 Release Wave 2 Plan

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

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Users online (2,988)