I have a gallery of names, a dropdown, a listbox and a submit button. The user filters the names via the dropdown, selects a name from the gallery, makes some selections from the listbox, then submits it and it gets patched to my data source. That works but is not ideal because of the delay after each patch.
I want to rather patch the listbox selections to a collection, then at the end of a session of multiple gallery item edits via the listbox I want to patch the whole collection to my data source once, but I’m having problems getting this right.
The gallery’s OnSelect:
Set(varRecord,ThisItem);
The submit button’s OnSelect:
Patch(
TraineeData,
{
PositiveBehaviours:Label4.Text
}
)
Label4’s’s Text:
Concat(ListBox1.SelectedItems,PositiveBehaviours,", ")
I created a collection of all filtered items when the user chooses an option from the dropdown. Dropdown1_14’s OnSelect:
ClearCollect(GroupTrainees,Gallery2_6.AllItems);
I’ve created a temporary button to patch the selections to the collection with its OnSelect:
Patch(
GroupTrainees,
{
PositiveBehaviours:Label4.Text
}
)
I think that works, but I’m having difficulty patching my collection to the data source afterwards. I’ve duplicated the temporary button and tried adjusting its code to have the collection go to the data source, but that throws an error, expecting a record while trying to pass it text, for example.
Any help or a point in the right direction would really be appreciated! Where am I going wrong with this?
Solved! Go to Solution.
Hi @JJKuZu ,
Try ForAll if you are using multiple value patch. Try the default formula mentioned below and update it according to your controls names.
ForAll(gallery.AllItems As Item, Patch(GroupTrainees, Defaults(GroupTrainees),{PositiveBehaviours: Item.Label4.Text}) )
If this post was helpful or you need more help please consider giving Thumbs Up and Tag me in your reply I'll be happy to help. If this post helped you solve your issue please click Accept as solution and provide Thumbs Up. This will help others find it more readily.
Hi @JJKuZu ,
Try ForAll if you are using multiple value patch. Try the default formula mentioned below and update it according to your controls names.
ForAll(gallery.AllItems As Item, Patch(GroupTrainees, Defaults(GroupTrainees),{PositiveBehaviours: Item.Label4.Text}) )
If this post was helpful or you need more help please consider giving Thumbs Up and Tag me in your reply I'll be happy to help. If this post helped you solve your issue please click Accept as solution and provide Thumbs Up. This will help others find it more readily.
Thank you!!
User | Count |
---|---|
118 | |
86 | |
83 | |
74 | |
69 |
User | Count |
---|---|
214 | |
179 | |
141 | |
109 | |
83 |