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

How to CDS Dynamic Content 'Lookup-Entity Primary Field'

I'm making a Flow that requires Dynamic Content from a Lookup Entity. I would like to return and use the Primary Field ('Name') from that Lookup Entity. It only displays options for the ID Value or the "Type" 
hsV9Gs2.png
Please tell me I can do this easily without having to manually create an Array in the flow with the ID and Primary Field... 

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @Reylin 

 

Thanks for you explanation.

 

Yes that is the limitation of lookup field in CDS connector. You have two options here.

 

1. Use the expand query see the below post

http://linnzawwin.blogspot.com/2019/12/power-automate-list-records-use-expand.html

 

2.  If you are using Dynamics then you can construct a FetchXML using the related entity and execute via CDS connector. To execute the CDS FetchXML query you need to create a solution, create flow, search for Common Data Service. Here you can see two CDS data connections. Select the second one from the list called Default Environment - Power Action Step List Records Here you can see FetchXML query option.

 

Thanks

 

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

5 REPLIES 5
abm
Super User
Super User

Hi @Reylin 

 

I am not sure I understood it correctly. So the lookup generally give you the text and id (GUID). If you looking the lookup entity (Name field) then you need to retrieve that entity to get the related value.

 

If I am wrong please explain a bit more about your scenario.

 

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


@abm wrote:

Hi @Reylin 

 

I am not sure I understood it correctly. So the lookup generally give you the text and id (GUID). If you looking the lookup entity (Name field) then you need to retrieve that entity to get the related value.

 

If I am wrong please explain a bit more about your scenario.

 

Thanks


Lookup only gave me GUID and type, not text. I want the text. I am surprised I do not get the primary field (text, name, title, whatever you wanna call it). 
I have to make Flow 'get' the entire Lookup Entity in order to get the primary field? 
I can do that... But if the Lookup Entity is very large, does that slow the flow down? It might be more efficient to just manually create an array with the names I need. 

Sorry, I'm just surprised that I can't return such an essential field of the entity. You'd think the Primary Field would be important, but I guess only GUID is

Hi @Reylin 

 

Thanks for you explanation.

 

Yes that is the limitation of lookup field in CDS connector. You have two options here.

 

1. Use the expand query see the below post

http://linnzawwin.blogspot.com/2019/12/power-automate-list-records-use-expand.html

 

2.  If you are using Dynamics then you can construct a FetchXML using the related entity and execute via CDS connector. To execute the CDS FetchXML query you need to create a solution, create flow, search for Common Data Service. Here you can see two CDS data connections. Select the second one from the list called Default Environment - Power Action Step List Records Here you can see FetchXML query option.

 

Thanks

 

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

Thanks for your solutions! 
Maybe Microsoft will update this action/feature someday. Especially because of their explanation of what Primary Field is supposed to be: 
fPUVv6w.png

@Reylin 

 

Microsoft has updated the CDS (ce) Get a record and List records actions. With the latest update of Common Data Service (current environment) connector, you can now query the formatted values of supported field types such as lookup display name, option set value label, formatted date/time by using the OData.Community.Display.V1.FormattedValue property of the field in the expression.

 

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

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.

May UG Leader Call Carousel 768x460.png

June User Group Leader Call

Join us on June 28 for our monthly User Group leader call!

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.

Power Automate Designer Feedback_carousel.jpg

Help make Flow Design easier

Are you new to designing flows? What is your biggest struggle with Power Automate Designer? Help us make it more user friendly!

Top Solution Authors
Top Kudoed Authors
Users online (1,498)