cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Loop through records in collection based on two sharepoint lists

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

1 ACCEPTED SOLUTION

Accepted Solutions
datamaster
Level 8

Re: Loop through records in collection based on two sharepoint lists

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.

View solution in original post

2 REPLIES 2
datamaster
Level 8

Re: Loop through records in collection based on two sharepoint lists

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.

View solution in original post

Anonymous
Not applicable

Re: Loop through records in collection based on two sharepoint lists

Thank you this worked perfectly!

 

Helpful resources

Announcements
Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Join THE global Microsoft Power Platform event series

Attend for two days of expert-led learning and innovation on topics like AI and Analytics, powered by Dynamic Communities

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Microsoft Business Applications Virtual Launch

Join us for the Microsoft Business Applications Virtual Launch Event on Thursday, April 2, 2020, at 8:00 AM PST.

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (7,972)