cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
OliverR-82
Helper V
Helper V

Look up a value in Sharepoint List B based on content type in List A

I have two lists in SharePoint:

  • List A accepts a number of custom content types
  • List B holds default values for each content type that can be added to list A

When a new item is created in list A I need to look up field values in list B based on the content type of the newly created item.

 

How would I go about doing this? I've initialized a variable that retrieves the content type of the newly created item in List A. But I don't know how I can then use that to get to the right item in List B. Basically, I would need to get to the item in List B where Title = varContentType (which is the variable that I've initialized).

I've looked online for answers and information but so far I've come up empty handed. Any help here would be greatly appreciated.

1 ACCEPTED SOLUTION

Accepted Solutions
annajhaveri
Community Champion
Community Champion

Hello @OliverR-82 ,

 

You need to create a flow with "When Item is created" trigger, then use Get Items action and configure it to get items from List B, provide the filter query in Get Items action as below, where columnname will be replace by your column name with which you want to filter items from list, and replace value with the value varContentType

columnname eq 'value'

 Then you need to use apply to each to use the values retrieved from Get Items action

Regards,
Anna Jhaveri

If I have answered your question, please mark the post as Solved to help other users to identify the correct answer
If you like my response, please give it a Thumbs Up.

View solution in original post

5 REPLIES 5
annajhaveri
Community Champion
Community Champion

Hello @OliverR-82 ,

 

You need to create a flow with "When Item is created" trigger, then use Get Items action and configure it to get items from List B, provide the filter query in Get Items action as below, where columnname will be replace by your column name with which you want to filter items from list, and replace value with the value varContentType

columnname eq 'value'

 Then you need to use apply to each to use the values retrieved from Get Items action

Regards,
Anna Jhaveri

If I have answered your question, please mark the post as Solved to help other users to identify the correct answer
If you like my response, please give it a Thumbs Up.

Hi @annajhaveri ,

 

Thank you for your reply. I'm happy to see that the solution doesn't seem to be overly complicated. However, I get an error on the filter query, as shown below:

OliverR-82_1-1608032932140.png

The error message is the following:

Column 'OMV2020' does not exist. It may have been deleted by another user.

 'OMV2020' is the value of the varContentType variable. It seems like the query is structured incorrectly? I have it set up in the action as shown below:

OliverR-82_3-1608033142706.png

Any ideas on what I did wrong?

annajhaveri
Community Champion
Community Champion

You need to put ContentType inside quotes '' in the filterquery.

Regards,
Anna Jhaveri

If I have answered your question, please mark the post as Solved to help other users to identify the correct answer
If you like my response, please give it a Thumbs Up.


@annajhaveri wrote:

You need to put ContentType inside quotes '' in the filterquery.


Ah, of course, I missed that.

It works like a charm now, I can't believe it was so simple. Thank you so much @annajhaveri !

annajhaveri
Community Champion
Community Champion

Thats great, let me know if you need further help

 

If my post has solved your issue, please mark my post as a solution!
If you liked my response, please consider giving it a thumbs up.


Thanks,
Anna Jhaveri

Regards,
Anna Jhaveri

If I have answered your question, please mark the post as Solved to help other users to identify the correct answer
If you like my response, please give it a 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.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

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.

MPA Licensing.jpg

Ask your licensing questions at the Power Automate AMA!

Join Priya Kodukula and the licensing team, super users and MVPs to find answers to your questions on Power Automate licensing.

Users online (1,791)