Hello!
Looking for a technique to update a selected column on a data collection using WixData.Update.
Context: have a large data collection with about 40 columns and certain fields need to get updated from different pages on the website. Having to include all the fields in the array is a painful method
and looking for a simplified method where I can update only a selected column.
You could easily write a backend function which you call from the frontend with an array of objects as one of its arguments (containing _id, fieldName_to_patch, fieldValue_to_patch). At the backend, you GET this row by _id. Now you have, inside an object, all current field values. Now you replace the fieldValue_to_patch for the fieldName_to_patch and update the row.
Hi Zano, thank you very much for your response. What you have suggested above was what I was using earlier but wanted to find a more simplified method to directly update only a selected field. As it is difficult to debut backend functions.
After fighting with it for several hours figured it out
. Basically using wixData.get. When assigned the new value to the array it automatically takes the rest of the values it seems.