cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
sienna28
Level 8

Sharepoint Flow - Is it possible to loop list and store list items in an array?

Is it possible to 

 

-go through a Sharepoint list & pull out ID based on a condition

-store that ID in an array

 

Loop through that array and update corresponding item in the list (using matching ID's)

 

Tried in both Sharepoint designer and online Sharepoint, but could not get very far

 

Any help appreciated

 

Thanks

 

 

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Sharepoint Flow - Is it possible to loop list and store list items in an array?

Hi @sienna28,

 

Could you please share bit more about your scenario?

Do you want to achieve your needs in PowerApps?

 

I have created a SP list on my side, the data structure as below:4.JPG

If you want to achieve your needs in PowerApps, I have made a test on my side, please take a try with the following workaround:

2.JPG

 

3.JPG

 

 

Set the OnSelect property of the "Save Array" button to following formula:

ForAll(
'20180814_case3',
If(ApprovalStatus="Approved",Collect(IdArray,ID))
)

On your side, you should type the following formula:

ForAll(
'YourSPList',
If(Column1="xxxxx",Collect(IdArray,ID))
)

Note: The Column1="xxxxx" represents the condition you want to add to filter the SP list item ID.  The '20180814_case3' represents the SP list data source within my app.

 

Set the OnSelect property of the "Update" button to following formula:

ForAll(
IdArray,
Patch(
'20180814_case3',
LookUp('20180814_case3',ID=Value),
{
Title:LookUp('20180814_case3',ID=Value).Title&"_Update",
TaskName:"",
Executor:""
}
)
)

On your side, you should type the following formula:

ForAll(
IdArray,
Patch(
'YourSPList',
LookUp('YourSPList',ID=Value),
{
Title:LookUp('YourSPList',ID=Value).Title&"_Update",
Column1:"xxx",
Column2:"xxx",
...
}
)
)

Note: The Column1, Column2, ...represents the columns in your SP list.

 

More details about Patch function in PowerApps, please check the following article:

Patch function

 

In addition, I think Microsoft Flow coukd be also a available way to achieve your needs. More details about Microsoft Flow, please check the following article:

https://docs.microsoft.com/en-us/flow/getting-started

 

Best regards,

Kris

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
Community Support Team
Community Support Team

Re: Sharepoint Flow - Is it possible to loop list and store list items in an array?

Hi @sienna28,

 

Could you please share bit more about your scenario?

Do you want to achieve your needs in PowerApps?

 

I have created a SP list on my side, the data structure as below:4.JPG

If you want to achieve your needs in PowerApps, I have made a test on my side, please take a try with the following workaround:

2.JPG

 

3.JPG

 

 

Set the OnSelect property of the "Save Array" button to following formula:

ForAll(
'20180814_case3',
If(ApprovalStatus="Approved",Collect(IdArray,ID))
)

On your side, you should type the following formula:

ForAll(
'YourSPList',
If(Column1="xxxxx",Collect(IdArray,ID))
)

Note: The Column1="xxxxx" represents the condition you want to add to filter the SP list item ID.  The '20180814_case3' represents the SP list data source within my app.

 

Set the OnSelect property of the "Update" button to following formula:

ForAll(
IdArray,
Patch(
'20180814_case3',
LookUp('20180814_case3',ID=Value),
{
Title:LookUp('20180814_case3',ID=Value).Title&"_Update",
TaskName:"",
Executor:""
}
)
)

On your side, you should type the following formula:

ForAll(
IdArray,
Patch(
'YourSPList',
LookUp('YourSPList',ID=Value),
{
Title:LookUp('YourSPList',ID=Value).Title&"_Update",
Column1:"xxx",
Column2:"xxx",
...
}
)
)

Note: The Column1, Column2, ...represents the columns in your SP list.

 

More details about Patch function in PowerApps, please check the following article:

Patch function

 

In addition, I think Microsoft Flow coukd be also a available way to achieve your needs. More details about Microsoft Flow, please check the following article:

https://docs.microsoft.com/en-us/flow/getting-started

 

Best regards,

Kris

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Helpful resources

Announcements
thirdimage

Power Apps Super User Class of 2020

Check it out!

thirdimage

Power Apps Community User Group Member Badge

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

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors (Last 30 Days)
Users online (6,008)