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

check type of dynamics 365 entity

Dear all, 

 

in the quote entity, potential customer can be both account or contact? i want to create a flow and use the Get Record action to get all the information related to that potential customer (account or contact), is it possible to identify the type of that field so i can use the Get Record action with the correct item identifier? for example if potential customer is an account my action would be something like this:

 

Capture.PNG

 

and if its contact then entity name will be contacts and item identifier will still be customer.

 

the reason is i want to avoid failed runs of my flow. if there is another solutions to this issue, it would be great.

 

 

thanks,

1 ACCEPTED SOLUTION

Accepted Solutions
abm
Super User
Super User

Hi @khedir 

 

You can determine this via Potential Customer Type.  This will return either accounts or contacts. Generally for the composite lookups there is always a type value returns to determine where it originated from.  Please see below.

 

image.png

 

My Test Result

 

image.png



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

@khedir 

Hi there. So, if you have CDS grab the quote first...you can use a condition that looks at the "Potential Customer Type" and then choose a different path (or "Get Record") for each.  I don't have any quotes in my instance, so I don't know what the possible data might look like, but that should get you going on a path.  You could do a quick "List records" to see what information comes in that field from other quotes.

 

Keep us posted.

-Ed

 

If you liked this reply, please give it a thumbs up! If this reply has answered your question or resolved your challenge, please consider marking it as a Solution. This helps other users find it more easily via search.

abm
Super User
Super User

Hi @khedir 

 

You can determine this via Potential Customer Type.  This will return either accounts or contacts. Generally for the composite lookups there is always a type value returns to determine where it originated from.  Please see below.

 

image.png

 

My Test Result

 

image.png



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

Hi @khedir 

 

Do you need any further help in this?

 

If your problem has solved, please go ahead and mark the post as solved by clicking “Accept as Solution” so that this thread will be marked for other users to easily identify!

 

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

hi @abm 

 

thank you so much, this is great!

 

Shaboo992
Frequent Visitor

Find the way to get the customer record for an entity.

Example: I want to get the contact - customer lookup this can be account or contact else blank. 

Step 1 : Get the contact record by contact id and select "_parentcustomerid_value" to return at least, can be ignored that will give full list of fields

 

Step 2 : Run the flow take the output of the flow action from above step and copy body on to Parse Json.

content use out put from get contact details - body & generate sample.

Shaboo992_1-1639070334594.png

 

Step 3: Important step to identify customer lookup logical name - Compose date oprator user - body('Parse_JSON')?['_parentcustomerid_value@Microsoft.Dynamics.CRM.lookuplogicalname that returns lookup logical name in case if you want get the out put as null use coalesce it returns value if blank coalesce(body('Parse_JSON')?['_parentcustomerid_value@Microsoft.Dynamics.CRM.lookuplogicalname'],'none')

Shaboo992_4-1639070761671.png

 

 

Step 4: Use switch statement and use output of the compose to branch the contact or account else default to get the record values

 

Step 5: Get contact or account details

 

 

Shaboo992_0-1639069893332.png

 

If you find useful please thumbs up.

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.

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
Users online (1,762)