I've used a Patch to Excel in a similar way in another app and had no issues but for some reason in this ticket management app, whenever I Patch my data, my gallery and table keep saving multiple copies of the same data even though I only pressed the button once.
I feel like it may be tied to the "ForAll' part but I'm not sure. Please help!
Solved! Go to Solution.
Hi @dsanf19
You have got that right. ForAll() loops though a collection of multiple items and adds every record as a new record. If you are simply trying to add a single record like the data in the form on the left side of the gallery, all you need is a patch with the names of the the fields and the control containing the data. Something like:
Patch(datasource, Defaults(datasource), {field1: TextInput1.Text, field2: Dropdown1.Selected.Value, etc.})
In a Patch(), The first element is the datasource or collection being patched, the second element, "Defaults()", indicates that a new record is being created. Third, the fields indicated inside the curly braces are populated with the values in the controls.
Hi @dsanf19
You have got that right. ForAll() loops though a collection of multiple items and adds every record as a new record. If you are simply trying to add a single record like the data in the form on the left side of the gallery, all you need is a patch with the names of the the fields and the control containing the data. Something like:
Patch(datasource, Defaults(datasource), {field1: TextInput1.Text, field2: Dropdown1.Selected.Value, etc.})
In a Patch(), The first element is the datasource or collection being patched, the second element, "Defaults()", indicates that a new record is being created. Third, the fields indicated inside the curly braces are populated with the values in the controls.
User | Count |
---|---|
248 | |
105 | |
82 | |
51 | |
43 |