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 Apps / Loop through records i...
Power Apps
Answered

Loop through records in collection based on two sharepoint lists

(0) ShareShare
ReportReport
Posted on by

I have a collection of items and I need to update each item based on a lookup in two sharepoint lists.

Like this:

collection records
ID     NewValue
1       BLANK
2       BLANK

3       BLANK

 

I need to look up each id in a sharepoint list, get a value from the first list, look up that value in another list to return my NewValue and update the NewValue field in this collection based on what is returned.

For each record in my collection

- get value 1 from sharepoint list
- use value 1 to find another value in another sharepoint list

- return second value to NewValue field in collection

I am stumped as to the best way to approach this.  TX

Categories:
I have the same question (0)
  • Verified answer
    datamaster Profile Picture
    250 on at

    Hi @Anonymous see sample below. I created three collections to represent the three sources but I am sure you can substitiude for a sharepoint list. In the last collection is where it puts it all back together.

     

    ClearCollect(
    colUser,
    {Name: "Paul"}
    );
    ClearCollect(
    colSocial,
    {
    Name: "Paul",
    Twitter: "@officpoweruser"
    }
    );
    ClearCollect(
    colWeb,
    {
    twitter: "@officepoweruser",
    Web: "https://officepoweruser.com"
    }
    );
    ClearCollect(
    colCombinedSub,
    AddColumns(
    colUser,
    "TheSocial",
    LookUp(
    colSocial,
    Name = Name
    ).Twitter
    )
    );
    ClearCollect(
    colCombined,
    AddColumns(
    colCombinedSub,
    "TheWeb",
    LookUp(
    colWeb,
    twitter = twitter
    ).Web
    )
    )

     

     

    ---------------------------------------------------OfficePowerUser.com----------------------------------------------------------
    If this post helps answer your question, please click on
    “Accept as Solution” to help other members. If you thought this post was helpful, please give it a Thumbs Up.

  • Community Power Platform Member Profile Picture
    on at

    Thank you this worked perfectly!

     

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 Apps

#1
WarrenBelz Profile Picture

WarrenBelz 765 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 272

Last 30 days Overall leaderboard