Hello everybody
Over the last couple of weeks i have learned a lot from you guys from reading the answers on this forum but i have an issue which i can't solve on my own.
I have created an input form and my data is saved into a collection(ProductList2) Now i want to add a button which can edit all the records in one column (column name = "Product") of the entire collection based on the input of a textbox. This is what i came up with but it doenst do the trick
ForAll(ProductList2; Patch(ProductList2.Product; {Product : TextInput1.Text }))
Can someone help me please
Best regards
Solved! Go to Solution.
Hi @rogierv
A quick way to update all the records in a collection is to use the UpdateIf function. The syntax would look like this:
UpdateIf(ProductList2;
true;
{Product : TextInput1.Text }
)
Hi @rogierv
A quick way to update all the records in a collection is to use the UpdateIf function. The syntax would look like this:
UpdateIf(ProductList2;
true;
{Product : TextInput1.Text }
)
Timl
Thank you for this solution. How simple can it be. You helped me a lot
Timl
Would you advise to always use Updat and UpdatIf when you use a collection? Because I used PATCH before. When i would use Update and want to change one cell in a row with the patch function that would be
Patch(ProductList2;Gallery3.Selected; {Product : TextInput1.Text })
But with the UPDATE function this is not gonna work
Hi @rogierv
In general, we would use Patch to modify or add a single record to a datasource/collection, and UpdateIf to update multiple records.
The Update function works a bit differently to Patch because it replaces a record in a data source with the record you specify, whereas Patch modifies the target record.
When updating a single record, one thing to be aware of is that Patch doesn't handle null values very well. In these circumstances, the UpdateIf function can provide a workaround.
User | Count |
---|---|
232 | |
109 | |
94 | |
58 | |
29 |
User | Count |
---|---|
293 | |
126 | |
106 | |
62 | |
57 |