I have a simple table that has 3 vendors.
Vendor 100 200 300 |
I created a gallery with the vendor number and added a toggle box with a default value of "On".
I'd like to create a collection of all of the values that are checked but running into an issue.
On my button I have this formula:
The formula works when all or none of the vendors are selected.
However, when I change the toggle button on vendor 100 to "Off" my collection is not right - no items show up, see below. I'm of course expecting to see vendor 200 & 300.
I can't figure out why this is occurring? What am I doing wrong? Thanks.
Solved! Go to Solution.
Hi@rob26r,
Based on the issue that you mentioned, do you want to collect and remove the corresponding item once the Toggle value changes?
Could you please share a bit more about the scenario?
I agree with @rsaikrishna, the key is to the OnCheck and OnUncheck property of the Toggle. The formula you provided will always collect all the items within the Gallery.
I have a test on my side, please check the following workaround.
My data source is a collection named 'Table1' as below:
Collect(Table1,{Vendor:100},{Vendor:200},{Vendor:300})
I set the Text property of the Label within the Gallery as below:
ThisItem.Vendor
Set the OnCheck property of the Toggle as below:
Collect(VendorCollect,ThisItem)
Set the OnUncheck property of the Toggle as below:
Remove(VendorCollect,ThisItem)
Set the Items property of the DataTable as below:
VendorCollect
Hope it could help.
Best Regards,
Qi
Alternate solution:
The toggle control has OnCheck , OnUnCheck properties.
OnCheck - Collect the vendor number into the collection.
OnUncheck - RemoveIf the vendor number exists in the collection.
While the user performing the toggle ON/OFF, the collection will be filled in. So, you can directly use the collection.
Regards
Krishna Rachakonda
If this reply helped you to solve the issue, please mark the post as Accepted Solution. Marking this post as Accepted Solution, will help many other users to use this post to solve same or similar issue without re-posting the issue in the group. Saves a lot of time for everyone. |
Hi@rob26r,
Based on the issue that you mentioned, do you want to collect and remove the corresponding item once the Toggle value changes?
Could you please share a bit more about the scenario?
I agree with @rsaikrishna, the key is to the OnCheck and OnUncheck property of the Toggle. The formula you provided will always collect all the items within the Gallery.
I have a test on my side, please check the following workaround.
My data source is a collection named 'Table1' as below:
Collect(Table1,{Vendor:100},{Vendor:200},{Vendor:300})
I set the Text property of the Label within the Gallery as below:
ThisItem.Vendor
Set the OnCheck property of the Toggle as below:
Collect(VendorCollect,ThisItem)
Set the OnUncheck property of the Toggle as below:
Remove(VendorCollect,ThisItem)
Set the Items property of the DataTable as below:
VendorCollect
Hope it could help.
Best Regards,
Qi
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
Power Platform release plan for the 2022 release wave 2 describes all new features releasing from October 2022 through March 2023.
User | Count |
---|---|
206 | |
97 | |
60 | |
51 | |
45 |
User | Count |
---|---|
258 | |
158 | |
85 | |
79 | |
58 |