Good Morning,
I have created a simple application with a gallery that has a toggle switch and a text input. I have a 'save' button outside of the gallery that I want to save the collection of changes into. I have it working if after each change I click on the save button, however, I would really like the save button to capture all changes once the end-user has made all of the required changes.
My formula that works for each row is as follows:
Collect(CollectCollection2, {ValidationAuditId: Label8.text, OverrideFlag: Toggle1.Value, OverrideDescription: TextInput.Text})
I have tried the following formula, however, this returns the entire gallery even if there are no changes:
Clear(CollectCollection2);
ForAll(
Gallary3.AllItems,
Collect(CollectCollection2, {ValidationAuditId: Label8.text, OverrideFlag: Toggle1.Value, OverrideDescription: TextInput.Text}));
Is there a way just to capture the changed records in the collection?
Thank you in advance.
Steve
Solved! Go to Solution.
I suggest you use an editable grid. Check this from Reza:
https://youtu.be/8I0Pt_8I6k8?t=33
------------
If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.
Hi, for the elements that the user can change, change the OnChange property to the below. this means it records the whole item whenever the toggle or TextInput is changed.
Collect(CollectCollection2, {ValidationAuditId: Label8.text, OverrideFlag: Toggle1.Value, OverrideDescription: TextInput.Text})
when you have your collection you can patch it to your data source using ForAll() and Pacth() for example,
ForAll(CollectCollection2 As MyUpdates, Patch([DATASOURCE],{ID: MyUpdates.ID},{[COL1]:MyUpdates.ValidationAuditId, [COL2]:MyUpdates.OverrideFlag.Value, [COL3]:MyUpdates.OverrideDescription}))
Hi @steveajones45 ,
How do you know what is changed? Your second code will certainly collect all the gallery. If for instance you had a checkbox called ckSave and checked each item you wanted saved, you could do this
Clear(CollectCollection2);
ForAll(
Gallary3.AllItems as aCol,
Collect(
Filter(
CollectCollection2,
ckSave.Value
),
{
ValidationAuditId: aCol.Label8.Text,
OverrideFlag: aCol.Toggle1.Value,
OverrideDescription: aCol.TextInput.Text
}
)
);
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
I suggest you use an editable grid. Check this from Reza:
https://youtu.be/8I0Pt_8I6k8?t=33
------------
If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.
User | Count |
---|---|
260 | |
109 | |
93 | |
57 | |
41 |