Hi there,
I'm busy creating an app (offline). For startes a customer is selected. A gallery is provided showing existing deal for the customer. The gallery source is a collection the app craetes on start (datasource = SQL tables).
I have managed to add new deals to the customer, achieved by using the collect fucntion to create a temp collection and a patch to the existing collection.
I have also managed to then to select the existing deals and change the deal name, this then gets patched to the collection. The problem however is, I cannot seem to figure out how to patch the update name to the sql gallery. It needs to look if the record exists based on the DEAL_ID, if it exists then patch the new DEAL_NAME. If a deal does not exist, to then patch the new deals added to the temp collection. Below link migh give you a better idea on the journey.
https://drive.google.com/file/d/14oSLA3sPDuKZTFyaE7WFpaJpdH35QEdl/view?usp=sharing
Summary: I would like to look up the matching DEAL ID (collection and datasource) and update the one column only THEN if the collections DEAL ID cannot find matching record, to take the records in the temp collection and write new rows into the DB.
Hope it makes sense.

Report
All responses (
Answers (