cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
jasmine2020
Microsoft
Microsoft

How to update a Lookup field in CRM using LogicApp Flow

I have created a LogicApp to pull data from CosmosDB and send to CRM. All of my fields cross over except the "lookup" fields. 

For example, Feature Category, is a Lookup field within CRM.

 

Any field that looks like this with the magnifying glass: 

 
 

lookup.PNG

 

 

 

My question, is how would I implement this in the Logic App?

Just doing this does not work, even when I add quotes. 

 

12.PNG

 

 

 

 

 

The Feature Category that I pulled from CosmosDB already  has a value:

 

13.PNG

 

 

 

My dilemma is:

How can I get this 'lookup' field to accept my value within the LogicApp?

 

I tried doing this and it does not work:

 

 

14.PNG

 

Any help or suggestions are appreciated.

2 ACCEPTED SOLUTIONS

Accepted Solutions
Jcook
Super User
Super User

Hello @jasmine2020 

 

You need to do a list records on the entity that the lookup is from.

 

Doing the list records will get you the Primary Id.

This ID can be identified by the guid.

For example if my entity is Accounts. The field I will need to grab from  the list records will be called Account.

 

this guid is what needs to be passed into the lookup.


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

If you like my post please hit the Thumbs Up


Proud to be a Flownaut!


Check out my blog for Power Automate tips,
tricks, and guides
FlowAltDelete





View solution in original post

@jasmine2020 

 

I think the only person who will know 100% what goes in that field is the person who built the data model.

 

But if I were to guess I think you should try putting the ProductInCRM dynamic content inside the Product field.

 

Now are all the Feature Categories from Cosmos unique? or will we have to implement a check / query to CDS to make sure it exists or not?

 

Once you create the record for Feature Categories. In the create a new record on your original entity (the one with the category lookup) you will pass the unique identifier from the create record from above. The dynamic content does a great job in telling you what the Unique identifier is. 


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

If you like my post please hit the Thumbs Up


Proud to be a Flownaut!


Check out my blog for Power Automate tips,
tricks, and guides
FlowAltDelete





View solution in original post

22 REPLIES 22
Jcook
Super User
Super User

Hello @jasmine2020 

 

You need to do a list records on the entity that the lookup is from.

 

Doing the list records will get you the Primary Id.

This ID can be identified by the guid.

For example if my entity is Accounts. The field I will need to grab from  the list records will be called Account.

 

this guid is what needs to be passed into the lookup.


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

If you like my post please hit the Thumbs Up


Proud to be a Flownaut!


Check out my blog for Power Automate tips,
tricks, and guides
FlowAltDelete





View solution in original post

Hi, 

 

I see the ListRecords option here, but I am still unsure of exactly how this works.

 

jasmine2020_0-1596510312323.png

So I am wanting to autopopulate the fields within CRM with the data that I have in CosmosDB:

 

jasmine2020_1-1596510382969.png

But because its a 'lookup' I keep getting an error. How would I use List Records to solve this, when it doesnt contain the 

'Feature Category' field that I need?

 

jasmine2020_2-1596510500853.png

I am new and am just trying to understand. Please add insight if you can. Thank you

 

Hi @jasmine2020 

 

Okay no problem. The first thing we need to do is understand the entities that are being used.

 

We need to check what the data types are inside the Features entity.

 

could you run the flow with the list records action on the features entity, like in your picture.

you could use the top count option and put 2 so only 2 records will get returned.

 

if you could please paste the output of the list records. This will help me better understand your data model so I can better assist you


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

If you like my post please hit the Thumbs Up


Proud to be a Flownaut!


Check out my blog for Power Automate tips,
tricks, and guides
FlowAltDelete





Sure thank you. Here is my full logic app:

jasmine2020_0-1596516526125.png

 

jasmine2020_1-1596516623602.png

 

jasmine2020_3-1596516678091.png

 

jasmine2020_5-1596516732340.png

 

 

Is this what you need?

 

Oh I think I misunderstood.

 

Do I need to actually 'Run' this?

 

 

 

jasmine2020_0-1596516969855.png

 

 

and then view the output??

 

Hi @jasmine2020 

 

Thank you for sharing.

Kind of, I actually need to see the data inside your feature entity

Could you add a list records under your http trigger.

Select your Features entity and, run the Logic app.

 

Please share a sample of the output from the list records action.


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

If you like my post please hit the Thumbs Up


Proud to be a Flownaut!


Check out my blog for Power Automate tips,
tricks, and guides
FlowAltDelete





jasmine2020
Microsoft
Microsoft

jasmine2020_0-1596517282102.png

 

 

Here are some of the outputs after I ran this: 

 

jasmine2020_1-1596517356424.png

 

 

 

Thanks @jasmine2020 

 

This helps a ton!

 

Does the feature entity contain any real data yet? Or are you basically transferring all cosmosDB to CDS?


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

If you like my post please hit the Thumbs Up


Proud to be a Flownaut!


Check out my blog for Power Automate tips,
tricks, and guides
FlowAltDelete





No thank you!

 

No it doesn't really have the data in it yet, I am just trying to see how I can push the data from cosmosDB into this 'lookup' field.

I had to add that parameter:

 

feature category

 

jasmine2020_0-1596517879727.png

 

 

The feature category looks like this in CRM:

jasmine2020_1-1596517917062.png

Since its a 'lookup', this is whats confusing me....

 

 

@jasmine2020 

So a lookup is just another table, that can relate to one or more other tables. And the way they relate is by using the PrimaryID / guid.

 

Okay so, since features has no data. You will have to create the lookup before you can use it.

 

Could you check and see if the features entity has a name field?


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

If you like my post please hit the Thumbs Up


Proud to be a Flownaut!


Check out my blog for Power Automate tips,
tricks, and guides
FlowAltDelete





Ok, how would I do this?

How do I check this please. Where would I have to go?

Oh check within CRM?

 

I do not see exactly 'Name' but other fields here. The field I wish to populate is 'Feature Category'

jasmine2020_0-1596519012624.png

 

@jasmine2020 

 

Add a Create record action in Logic apps and select the features entity. What fields show up to create a record


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

If you like my post please hit the Thumbs Up


Proud to be a Flownaut!


Check out my blog for Power Automate tips,
tricks, and guides
FlowAltDelete





ok yes this is what I have attempted to do:

 

 

jasmine2020_0-1596519398772.png

 

 

I would like to add this feature category here. But when I add this, how do I set it to where it works with the lookup to match this:

jasmine2020_1-1596519469832.png

 

 

@jasmine2020 

 

Sorry I am all over the place here. I think I understand now.

 

Is there a entity called feature categories.

Basically I am asking if you know where the feature category lookup is, is it the productFeatures entity I saw in one of your pictures before?


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

If you like my post please hit the Thumbs Up


Proud to be a Flownaut!


Check out my blog for Power Automate tips,
tricks, and guides
FlowAltDelete





no worries

 

No, there is an entity called Features, and "feature category' lives within it

jasmine2020_0-1596520146233.png

 

 

Below is CRM

 

jasmine2020_1-1596520228408.png

 

Oh wait you are correct.

 

 

There is a feature category entity, how should I proceed?

jasmine2020_0-1596520360996.png

 

Is this how I would "Create" this field?

 

 

What goes in the product field?

 

 

jasmine2020_0-1596520510432.png

 

@jasmine2020 

 

I think the only person who will know 100% what goes in that field is the person who built the data model.

 

But if I were to guess I think you should try putting the ProductInCRM dynamic content inside the Product field.

 

Now are all the Feature Categories from Cosmos unique? or will we have to implement a check / query to CDS to make sure it exists or not?

 

Once you create the record for Feature Categories. In the create a new record on your original entity (the one with the category lookup) you will pass the unique identifier from the create record from above. The dynamic content does a great job in telling you what the Unique identifier is. 


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

If you like my post please hit the Thumbs Up


Proud to be a Flownaut!


Check out my blog for Power Automate tips,
tricks, and guides
FlowAltDelete





View solution in original post

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

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

Microsoft Ignite 768x460.png

Find your focus

Explore the latest tools,training sessions,technical expertise, networking and more.

Top Solution Authors
Top Kudoed Authors
Users online (2,571)