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

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

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

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

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

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

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
MPA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

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.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Top Solution Authors
Users online (2,008)