cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
cmalm
Helper II
Helper II

Nested Loops / Iterations

I have a collection that I need to loop through. Every item in that collection has a numeric field that is user specified. I need to patch a new record into an SP List not only for each item in the collection, but duplicates of each item based off of the value of the numeric field. 
Due to Power Apps Limitations, I currently have a timer that achieves this in the OnTimerEnd property after a button is selected. However, the minimum value of the Duration property that allows the code to work correctly is 800 ms. This is much too slow.
I've seen an alternative solution posted that uses FirstN (https://powerusers.microsoft.com/t5/Building-Power-Apps/Performing-a-FOR-loop-in-PowerApps/td-p/4447...), but it is unclear whether or not this is applicable to my problem.

All suggestions are appreciated. Thanks.

3 REPLIES 3
KrishnaV
Super User III
Super User III

Hi @cmalm ,

 

Unfortunately, we don't have any other way in PowerApps directly other than using timer control with a Button onSelect property. if not send the collection to Flow and that will run the job on the backend for you.

Note: The latency is not with  PowerApp or code you implemented, it the issue with SharePoint API performing the operations.


I hope this resolved your issue if you see any challenge/need further help please let me know I am always happy to do it for my community.

Regards,
Krishna
If this post helps you give a 👍 and if it solved your issue consider Accept it as the solution to help the other members find it more.

 


I hope this resolved your issue if you see any challenge/need further help please let me know I am always happy to do it for my community.

Regards,
KrishnaV
Business Applications MVP, Microsoft Certified Trainer
Twitter | Linkedin | YouTube | GitHub
If this post helps you give a and if it solved your issue consider Accept it as the solution to help the other members / new members of the community.

Perhaps creating a second collection from the first and then patching into a SP List with ForAll would solve the latency issue?

Hi @cmalm ,

 

I don't think so ... as I said it is the issue with API not with your code or the approach you followed.

 

I hope this resolved your issue if you see any challenge/need further help please let me know I am always happy to do it for my community.

Regards,
Krishna
If this post helps you give a 👍 and if it solved your issue consider Accept it as the solution to help the other members find it more.


I hope this resolved your issue if you see any challenge/need further help please let me know I am always happy to do it for my community.

Regards,
KrishnaV
Business Applications MVP, Microsoft Certified Trainer
Twitter | Linkedin | YouTube | GitHub
If this post helps you give a and if it solved your issue consider Accept it as the solution to help the other members / new members of the community.

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Top Kudoed Authors
Users online (3,585)