Hi
I have a app where i am doing some ClearCollect(Filter(ForAll( commands and displaying the result in a Gallery. The data comes from a huge SQL database. The problem is when user goes back to previous screen the ClearCollect command stil collecting.
Is there a way to abort the ClearCollect command when the user klick Back()
The command for collecting data is placed on the select gallery on previous page.
The user selects from a project gallery that navigates to projectdetail screen. who runs a selected project filtering on documents linked to that project in a gallery.
The problem is that there can be up to 100 documents linked. so if the user clicks the back button the command is stil collecting data. and he have to wait til the dots stops flying in the top of the screen before ha can click a new project..
Navigate(DetaljProsjekt);;
ClearCollect(
Dokumenter1;
RenameColumns(
Filter(
'[crm7].[APPOINTMENT]';
Galleryprosjekt.Selected.project_id = project_id
);
"document_id";
"Dokument_id"
)
);;
Clear(Dokumenter2);;
ForAll(
Dokumenter1;
Collect(
Dokumenter2;
Filter(
'[crm7].[DOCUMENT]';
Dokument_id = document_id
)
)
)
If I understand it right, you have the ClearCollect in the OnSelect property of the gallery on screen 1. The user clicks on an item in this gallery and the collection process starts, and the user is navigated to screen 2. However, upon arrival on screen 2, the user realises he needs to go back and select another item from screen 1. And your ask is when the user clicks on Back(), how do we stop the current collection process?
---
If you like this reply, please give kudos. And if this solves your problem, please accept this reply as the solution. Thanks!
Hardit(Haman)
Did you try adding a Clear(CollectionName) on the OnVisible property of Screen1?
---
If you like this reply, please give kudos. And if this solves your problem, please accept this reply as the solution. Thanks!
Hardit(Haman)
Sounds good.
---
If you like this reply, please give kudos. And if this solves your problem, please accept this reply as the solution. Thanks!
Hardit(Haman)
Sorry. not working. Did what you sugested and put a Clear(Dokumenter1) on OnVisible for screen 1 and list Dokumenter1 gets cleared, but the Forall command stil running. 100 documents = 30sec.
I added a CountRows for both lists on screen 1 to follow.
Other suggestions?
Stay up tp date on the latest blogs and activities in the community News & Announcements.
Mark your calendars and join us for the next Power Apps Community Call on January 20th, 8a PST
Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.
User | Count |
---|---|
200 | |
184 | |
69 | |
42 | |
34 |
User | Count |
---|---|
341 | |
266 | |
114 | |
64 | |
64 |