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

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Returning fields from ...
Power Automate
Unanswered

Returning fields from multiple items to one

(0) ShareShare
ReportReport
Posted on by 6

Is it possible to write a flow to update a Sharepoint List Item Field by searching for that Items' ID number in another List, and returning all the ID numbers of the multiple records in the new list that have the ID number from the first list, and have those new ID numbers added to the first list as links back to their associated item? I've done this for a one-to-one lookup, but not one-to-multiple and wasn't sure how to get started. 

 

This is how I would want it to look after the update. Both IDs are unique to their respective table. 

 

List 1 ID      List 1 Name     List 2 IDs

ID-01            Name 1          ID-01-01,

                                           ID-01-02

 

List 2 ID      List 1 ID       List 2 Name

ID-01-01      ID-01            Name 1.1

ID-01-02      ID-01           Name 1.2

 

Thanks!

Categories:
I have the same question (0)
  • David- Profile Picture
    1,254 on at
    Re: Returning fields from multiple items to one

    Yes, if I think I understand what you want to do. You would use the Get list items action and point it to list two and filter the field that is storing the ID of the ID from your first list. Then use a condition and check to make sure that records were found that match. If so, you can then use an apply to each and update the items in list two with the matching ID from list one.

     

    Web capture_16-7-2022_185652_emea.flow.microsoft.com.jpeg

  • mjkershaw Profile Picture
    6 on at
    Re: Returning fields from multiple items to one

    Thanks so much for the reply! I am testing this out and will confirm if it works!

  • mjkershaw Profile Picture
    6 on at
    Re: Returning fields from multiple items to one

    What I am trying to do is update List 1 with the ID from List 2. I want to look up all the items in List 2 that have the List 1 ID, and then return them all to a field in List 1.  So if list two is the child records, I want to be able to link from the parent record in List 1 to the all the children in List 2. Does that make sense? 

  • David- Profile Picture
    1,254 on at
    Re: Returning fields from multiple items to one

    Yes, I think so. For example I have a personnel requisition form where they choose the IT bundle that is required for the new hire. So I want to find all of the requisitions for each bundle type. I would use these actions:

    David_0-1658418138336.png

    1. For this example, I am just manually entering the ID of the IT user bundle (List 1) that I want to look up all items with that bundle ID in list 2. The get items action is filtered to the ID I want to find:David_1-1658418297875.png
    2. Then I initialize a variable of type Array
    3. Then I get the length of how many items were returned from the get action in the compose action with the following expression: length(outputs('Get_items')?['body/value'])
    4. Then the condition checks to make sure Compose Length is greater than zero
      David_2-1658418462464.png
    5. If yes, do an apply to each and append the ID to my array that I created:
    6. You can do what you need to next, but for an example I just output the results of the append array to a Compose action:
      David_4-1658418620381.png
    7. Which will give you what I think you are looking for in an array:
      David_5-1658418668023.png

       

     

     

     

     

     

     

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 462 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 456 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard