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

Getting Lookup records from D365

I am looking for a neater way to get Lookup records from the opportunity entity in D365 so I can use the lookup values for other actions such as creating new records.

 

Is there a neater way to get lookup records other than using multiple 'Get A record' actions

 

Capture.PNG

1 ACCEPTED SOLUTION

Accepted Solutions
ACahill
Community Support
Community Support

Hi @AlvinH 

 

From the description, I understand you need help finding a tidier way to implement the get records for a record created without getting for all related entities. I reviewed and I understand the need for a tidier means to have this done, honestly from my experience there isn’t any way I have come across personally.

 

I have previously discussed this with a few internal escalation engineers and it seems the only current means to get the specific details is getting individual records for the created opportunity.

 

If needed, you could provide me with an export copy of your flow to see what I can do to recreate this and have the flow running as intended, that may also be something we can further review, let me know your thoughts on this.

 

 

View solution in original post

10 REPLIES 10
ManishJain
Solution Sage
Solution Sage

Hi @AlvinH ,

 

Using HTTP REquest with Azure AD connector we can do get / post queries to D365.  IF you have idea of building Odata query with expanded entities do so. if not use xrmtoolbox to help you do that. Just query your required entity and add linked entities in it. From the view option select Odata4.0 option to get that query(this web api contains your org details as well so while you put this in url just remove it)

 

 

Once you get query simply use it like this in screenshot

Capture.JPG

 

Thanks

@ManishJain I do not follow sorry i am new to flow. I have an Opportunity record and I want to get The Account, Contact & Currency from the Opportunity so I can use the lookup values for other actions. I just want a simplier way to get the related lookups.

Hi @AlvinH ,

 

I have taken this query from XrmToolbox 

 

/api/data/v9.1/opportunities?$select=name&$expand=customerid_account($select=name),transactioncurrencyid($select=currencyname)&$filter=name eq 'Opp_NAME' and customerid_account/accountid ne null and transactioncurrencyid/transactioncurrencyid ne null

 

this is what you need to put in the url of request. Please replace Opp_NAME with your opportunity name .

 

Thanks

Which tool did you use in XRMtoolbox?

 

You said "Please replace Opp_NAME with your opportunity name ." but I would what the opportunity to come from the 'When a record is updated' action, therefore what should be in the place on Opp_Name?

 

 

@ManishJain 

Hi @AlvinH ,

 

In that case you should be replacing Opp_Name with Opportunity Name coming from Get Record. Just remove the 'Opp_Name' to '' and place cursor inside single quote and select Opportunity Name from Get Record.

 

Alternatively much better solution is to use : 

 

/api/data/v9.1/opportunities(Opportunity)?$select=name&$expand=customerid_account($select=name),transactioncurrencyid($select=currencyname)&$filter=customerid_account/accountid ne null and transactioncurrencyid/transactioncurrencyid ne null

 

Capture.JPG

 

Thanks

Hi @ManishJain 

 

So I have put in the Invoke an HTTP request action. When trying to create a new record how can I pull the currency & the contact from the 'Invoke an HTTP request' into my 'Create a new record' action?

 

AlvinH_1-1595341596758.png

 

 

Hi @AlvinH ,

 

Here is what you need to do : 

 

first(outputs('Invoke_an_HTTP_request')?['body/value'])?['transactioncurrencyid/name'] for currency
first(outputs('Invoke_an_HTTP_request')?['body/value'])?['customerid_contact/name'] for contact . 
 
My Apologies I did not understand your requirement from beginning. It is straight forward if you want to put currency, contact from Opportunity record . All you need is just click on those fields and in the pop up that comes up with dynamic content and expression just type those fields .
 
For ex. Capture.JPG
 
Sorry for inconvenience.
 
Thanks

Hi @ManishJain let me start again sorry for confusion.

 

i am getting an opportunity and when a condition is met I may creAte a copy of the opportunity pulling details such as as name, estimated close date etc. I also want to use the currency and contact but you cannot just select  the ‘Contact (value)’ and ‘Currency (value)’ in the create new opportunity action I would need to use the Get a record like I did in the original (1st) post. 

 

What i want to know is there an easier way to get an opportunity and it’s related entities (contact, currency etc) and use the values in a create/update action, rather than having multiple get a record actions ?

ACahill
Community Support
Community Support

Hi @AlvinH 

 

From the description, I understand you need help finding a tidier way to implement the get records for a record created without getting for all related entities. I reviewed and I understand the need for a tidier means to have this done, honestly from my experience there isn’t any way I have come across personally.

 

I have previously discussed this with a few internal escalation engineers and it seems the only current means to get the specific details is getting individual records for the created opportunity.

 

If needed, you could provide me with an export copy of your flow to see what I can do to recreate this and have the flow running as intended, that may also be something we can further review, let me know your thoughts on this.

 

 

Hi @AlvinH ,

 

I completely agree with @ACahill . The only thing that you can do is after the trigger is made you can make A get Record call and include all your related entities in Expand Query under advanced options.

 

Thanks

Helpful resources

Announcements
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.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

PA Survey Carousel Image.png

We want to hear from you!

If you are a small business ISV/Reseller, share your thoughts with our research team.

Users online (1,024)