• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Query cloud, modify a single key, update cloud
#1
This code will demonstrate how to query cloud data for a specific key and value. It will then update that value for all the matching records and update the cloud.

Code:
on mouseUp
    local tInputA, tOutputA, tUpdatedLastName, tTableID
   
    put "Franklin" into tUpdatedLastName
    put cdb_tableID("Agents") into tTableID
   
    --QUERY FOR MATCHING DATA
    put cdb_query("lastName","=","Talluto","Agents","cloud","recordList") into tOutputA
   
    --REPEAT THROUGH EACH RECORD AND UPDATE THE 'lastName' VALUE FOR EACH RECORD FROM THE QUERY
    repeat for each line xRecordID in tOutputA
         put tUpdatedLastName into tInputA[tTableID][xRecordID]["lastName"]
    end repeat
   
    --UPDATE DATA IN THE CLOUD
    cdb_batchUpdate tInputA, "cloud"
end mouseUp
  Reply


Messages In This Thread
Query cloud, modify a single key, update cloud - by mark_talluto - 04-01-2020, 05:49 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)