web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Update items from a SP...
Power Automate
Unanswered

Update items from a SPO list with multiple values from different list items (vlookup with multiple matches)

(0) ShareShare
ReportReport
Posted on by 76

I have the following scenario for a People search solution in SPO. The list needs to be updated with Eduction information from another list.

 

  1. SharePoint List A: Employees

This list contains employee information with columns: EmpID, Name, Email and Phone and is used to search employee information.

webmagic2022_3-1672254184284.png

 

 2. SharePoint List B: Education

 This list contains education information from each employee. Due the structure of the external HR system multiple records will be created for each degree obtained. The employee id may appear multiple times in the list, as an example below:

webmagic2022_4-1672254213518.png

 

Goal:

I would like to setup a flow by using the action Get Items and perform a for each loop to get the items from List B (Column Education) and synchronise them with action Update Item to the “Education” column of List A. Each value obtained needs to be separated with a dash.

List A: populated with Education information from list B

webmagic2022_6-1672254397054.png

 

I have been thinking for a while but it is difficult to find a good solution to collect items in an array and update each item with the values from the Education column from List B.

 

So far; my flow is as follows:

1) Manually Trigger

2) Get Items from List A

3) Get Items from List B

4) Set Variable (this is where I am stuck on how to proceed further)

 

webmagic2022_7-1672254782869.png

 

Anyone can give some guidance to accomplish this?

 

Thanks in advance for your help!

 

 

Categories:
I have the same question (0)
  • Ed Gonzales Profile Picture
    4,531 Most Valuable Professional on at

    @webmagic2022 

    Hi there.  You're very close.  Here's what I might try:

    • Get the items from list A
    • Get the items from list B
    • Inside the following Apply to each loop, cycle through each EMP ID from List A
    • First action inside the loop is a Filter Array where the array being filtered is List B and the criteria (left side "Choose a value") is EmpID from List B, and the right side is an expression: "items('Apply_to_each')?['EmpID']" or something similar (without the double quotes).  This basically says "Show me all of the records from List B, where the empid is equal to the one we're looking at from list A.
    • This will (hopefully) give you an array of ALL of the columns from List B that match.  So use a Select action on the output of that step and only pull out the Education column.
    • Now, you'll have an array with possibly multiple rows of just the education columns that match that EmpID.  So use a Compose action with an expression using Join() where the parameters are the output from your Select, and the pipe as your delimiter.  Something like this: join(body('Select'),' | ')
    • Use the output of that compose to update the education column in List A

    Hopefully, that's enough to get you started.  Keep us posted.

    -Ed

     

    If you liked this reply, please give it a thumbs up! If this reply has answered your question or resolved your challenge, please consider marking it as a Solution. This helps other users find it more easily via search.

  • webmagic2022 Profile Picture
    76 on at

    @edgonzales 

    Thanks for your great explanation. Today I started to follow your guidance. But I got stuck to get the result I expect.

     

    What I have done so far:

    List A contains employee information and is the list to populate the Education information. In Dutch "Opleidingen"

    Personeelsnummer=EmpID from list A

    List A:

    webmagic2022_0-1672324651550.png

     

     

    List B contains the educations for each employee. For each education a separate row.

    webmagic2022_1-1672324803769.png

    The flow I have created:

    Get Items from LIST A and LIST B

    webmagic2022_2-1672324850331.png

    webmagic2022_5-1672327027718.png

     

     

     

    Result after update items: ,not correct

    webmagic2022_4-1672326655299.png

    webmagic2022_6-1672327959835.png

     

    Any clue? 

     

     

  • Verified answer
    grantjenkins Profile Picture
    11,063 Moderator on at

    @webmagic2022 This is what @edgonzales was suggesting.

     

    For this example, I'm using the following lists: ListA and ListB. Note that the Title field in both lists contains the Emp ID.

     

    grantjenkins_0-1672328389654.png

     

    grantjenkins_1-1672328412590.png

     

    Full flow below. I'll go into each of the actions.

    grantjenkins_2-1672328455576.png

     

    Get items List A and Get items List B retrieve all the items from the two lists.

    grantjenkins_3-1672328533145.png

     

    Apply to each iterates over the values from List A.

    grantjenkins_4-1672328588178.png

     

    Filter array uses the value from List B and filters where List B Title is equal to List A Title (the Emp IDs).

    grantjenkins_5-1672328696868.png

     

    Select uses the output from Filter array and uses the following expression to extract just the Education values. Note that I use Text mode here to get a simple array of values (see arrow on screenshot below).

    item()?['Education']

    grantjenkins_6-1672328813948.png

     

    Finally, Update item will add the Education values joined by " | ". The expression used for the join is:

    join(body('Select'), ' | ')

    grantjenkins_7-1672328922354.png

     

    After running the flow, we should have the following output in List A.

    grantjenkins_8-1672328994235.png



    ----------------------------------------------------------------------
    If I've answered your question, please mark the post as Solved.
    If you like my response, please consider giving it a Thumbs Up.

  • Verified answer
    webmagic2022 Profile Picture
    76 on at

    @grantjenkins : Thank you very much, you make my day!

     

    webmagic2022_0-1672333315980.png

     

    Thanks for detailed explanation and Power Automate example you have created! 

     

    Also many thanks to @edgonzales ! 

     

    Best wishes for 2023! 

  • jairamjidgekar Profile Picture
    2 on at

    Hi @grantjenkins 

     

    Thank you for the explanation. 

     

    When I perform the same steps, my lookup columns still coming as empty array in the "select" operation. 

     

     "Topics": [],
    "Topics#Id": [],

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard