Hello Everyone,
Good day!
I need your help on how I can improve the performance when clicking a button.
I have this collection that contains thousand of data/entries and there are two buttons used to filter the display in gallery.
example: the button one filters the collection request on which status = 'complete' and the other button filters the same collection with status = 'freeze'. The problem is when clicking button 1 from button 2 or vise versa it loads like 10-15 sec. Is this normal or still can be improve?
Sample code of button 1:
ClearCollect(
colFilteredUserRequests,
Filter(
colUserRequests,
Status.Value = 'Complete'
)
);
Sample code button 2:
ClearCollect(
colFilteredUserRequests,
Filter(
colUserRequests,
Status.Value = 'Freeze'
)
);
Sample image: I click draft but takes 10-11 sec of time to load
Solved! Go to Solution.
Hi @YamiteKudasai ,
As you mentioned there are thousands of entries in the source collection, and currently you are creating several collections from blank based on the buttons clicking and filter on a choice column value, this two actions will both cost time.
I would provide you another approach to accomplish this scenario with better performance:
1. Change that choices type column to text while creating the source collection, use AddColumns function:
ClearCollect(
colUserRequests,
RenameColumns(
DropColumns(
AddColumns(
YourTable,
"Status2",
ThisRecord.Status.Value
),
"Status"
),
"Status2",
"Status"
)
)
2. OnSelect of those buttons, set to a variable to include the text, e.g. Active button:
UpdateContext({Qtext: "Active"})
3. Use the variable as the criteria in the filter and append in Items of the Gallery:
Filter(
colUserRequests,
Status = Qtext
)
Hope this helps.
Best regards,
Community Support Team _ Jeffer Ni
If this post helps, then please consider Accept it as the solution to help the other members find it.
Community Support Team _ Jeffer Ni
If this post helps, then please consider Accept it as the solution to help the other members find it.
Hi @YamiteKudasai ,
As you mentioned there are thousands of entries in the source collection, and currently you are creating several collections from blank based on the buttons clicking and filter on a choice column value, this two actions will both cost time.
I would provide you another approach to accomplish this scenario with better performance:
1. Change that choices type column to text while creating the source collection, use AddColumns function:
ClearCollect(
colUserRequests,
RenameColumns(
DropColumns(
AddColumns(
YourTable,
"Status2",
ThisRecord.Status.Value
),
"Status"
),
"Status2",
"Status"
)
)
2. OnSelect of those buttons, set to a variable to include the text, e.g. Active button:
UpdateContext({Qtext: "Active"})
3. Use the variable as the criteria in the filter and append in Items of the Gallery:
Filter(
colUserRequests,
Status = Qtext
)
Hope this helps.
Best regards,
Community Support Team _ Jeffer Ni
If this post helps, then please consider Accept it as the solution to help the other members find it.
Community Support Team _ Jeffer Ni
If this post helps, then please consider Accept it as the solution to help the other members find it.
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.
User | Count |
---|---|
189 | |
53 | |
52 | |
38 | |
37 |
User | Count |
---|---|
282 | |
97 | |
86 | |
80 | |
77 |