cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
OliverR-82
Advocate II
Advocate II

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

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

Top Solution Authors
Top Kudoed Authors
Users online (53,852)