Confused about how to use "recordData" in Query - Printable Version +- LiveCloud Forums (https://forums.livecloud.io) +-- Forum: General (https://forums.livecloud.io/forumdisplay.php?fid=1) +--- Forum: General (https://forums.livecloud.io/forumdisplay.php?fid=3) +--- Thread: Confused about how to use "recordData" in Query (/showthread.php?tid=123) |
Confused about how to use "recordData" in Query - simon.schvartzman - 09-09-2019 Hi guys, this is probably a very dum question but what can I do... According to the documentation the Output for a query using "recordData" as the "pResultFormat" parameter is: (Array) - If pResultFormat is "recordData":
Using the Example of the documentation recordData Output: # tOutputA["87654321-abcd-1234-cdef-1234567890ab"]["cdb"] - metadata # ["firstName"] - "Jenny" # ["lastName"] - "Smith" # ["age"] - 46 # ["income"] - 100000 Where do I get "87654321-abcd-1234-cdef-1234567890ab" from? Moreover let's say the query returns 4 records, how do I navigate trough each of them? Can you please provide a complete example? Many thanks Thanks RE: Confused about how to use "recordData" in Query - mark_talluto - 09-09-2019 This is a great question. The data is returned to you as a LiveCode array. I took a picture of the result I got from running some test code I put together. You can see that the data returned contains three matching records from my query. I added a few little things that may be useful in what you can do once you have the data. In this case, I am modifying one of the keys on each record and then batch updating the changes to the cloud. Here is the code that generated the results: Code: local tOutputA, tKeys, tTableID, tUpdatedDataA RE: Confused about how to use "recordData" in Query - simon.schvartzman - 09-10-2019 Thanks Mark, it is pretty obvious now. |