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

Get Dynamics CRM field text instead of value

I'm currently building a flow to pull data from a CRM entity (leads entity) and email it out to somebody (essentially an email notification that a lead has been assigned to somebody).

But, certain fields that I'm pulling are only giving me the value rather than the text.

i.e. the Lead Rating field, instead of showing 'Warm' it's giving me '2'.

I also have a lookup field to an Account, and instead of getting the Account name in the email, I'm getting the Account ID value.

 

Is there a way I can get the text rather than the values?

 

For reference, I'm pulling the data using CDS.

14 REPLIES 14
Super User III
Super User III

Hi @bjarvis 

 

For lookup fields by default you only get the GUID. To get the account name you need to use another flow step called Get Record and pass the Id from our current step. For option set I will get back to you soon.

 

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
Super User III
Super User III

Hi @bjarvis 

 

So to get the option set value text you need to add a compose statement and add the below. Here I am using a for each loop for getting all the records. My option set field is called ajb_rankingstatus. You won't get this from the dynamic properties. You need to add this under the expression function. That will do the trick 🙂 

 

items('Apply_to_each')?['_ajb_rankingstatus_label']
 
If you need any help in this let me know.
 


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

@abm thanks for the replies - the first one worked perfectly, however with the second answer for option sets i'm getting an error.

The field is 'leadsourcecode' 

 

my expression is: 

items('Apply_to_each')?['_leadsourcecode_label']

 

the error i'm getting is:

 

The template validation failed: 'The repetition action(s) 'Apply_to_each' referenced by 'inputs' in action 'Compose' are not defined in the template.'.

Hi

 

Did you added the compose step inside the loop? You can directly add the expression under the filed without using compose as well.



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, I think I've misunderstood your instructions here.

 

Should the compose with expression be inside an 'Apply to each' action?

 

If so, what is the input to the Apply to each? I only have the option for 'Value' as per the image below.

 

Capture.PNG

Super User III
Super User III

Hi @bjarvis 

 

I was suggesting based on your error. If you using Get Record and returning only one record you don't need a loop so that compose can be outside the loop. Like I mentioned earlier you can do without compose as well. Directly map the field using the expression which I mentioned earlier.



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
Regular Visitor

Hello sir!

 

Thanks for your help above. I am still getting errors on mine as well and have looked throughout the entire internet and can't get mine to work too. I'm just trying to get the option set value text.

Super User III
Super User III

Hi @Shap1 

 

Could you post a screen shot of your flow?

 

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
Solution Sage
Solution Sage

Hi @bjarvis ,

 

Please look at the following blog to help you better with optionsets:

 

https://linnzawwin.blogspot.com/2020/07/get-lookup-display-name-and-option-set.html

 

Thanks

 

Super User III
Super User III

Hi @bjarvis 

 

Do you still need help in this? 



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
Regular Visitor

Are you able to meet via Teams or anything? Would love to chat for a moment if you ever have the time 🙂

Super User III
Super User III

Hi @Shap1 

 

Thanks for the screen share. Couple of things.

 

1. You need to use the current environment CDS (Dataverse) connector to get the Multiple OptionSet values.

2. To get the current user email you need to filter by current owner GUID value (List Rows) (systemuserid eq 'Guid')

3. To get the option set text values (For single/Multiple option sets) you need to check the run history and use the relevant (Triggerbody() / body()) schema names from the run history. Generally the schemas are _filedname_value.

 

Hope it was helpful.

 

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
Regular Visitor

You have been absolutely great @abm! Thank you so very much with your help! A+

Super User III
Super User III

Hi @Shap1 

 

Did you originally created this thread? If so please mark it as solution accepted.

 

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

Helpful resources

Announcements
Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

New Super Users

Meet the Power Automate Super Users!

Many congratulations to the Season 1 2021 Flownaut Crew!

New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

MPA Community Blog

Power Automate Community Blog

Check out the community blog page where you can find valuable learning material from community and product team members!

Users online (76,516)