03-16-2020, 05:05 PM
The function for getting a list of anything from recordIDs to any combination of keys in your table is: cdb_list()
After the rework on the API, we needed to come back an update the docs to explain how to use this API.
https://docs.livecloud.io/List/
This API is unique in that it does not return an array. It is instead a very simple line delimited string. You might find this useful for getting all the recordIDs of a table. Or, you may store data that is used to build text in your UI. The output of this API could be directed to the text of the control without any cleaning. You may want to sort the data if that is important.
It could also be used to count duplicate values. Build an array from the list and have an accurate count of how many of a given value are duplicates.
--GET LIST OF FIRST NAMES IN TABLE Customers
--ACCESS DATA IN THE CLOUD
--FROM THE KEY firstName
put cdb_list("Customers","cloud","firstName") into tOutput
--REPEAT THROUGH THE STRING AND COUNT EACH NAME
repeat for each line xLine in tOutput
add 1 to tCounterA[xLine]
end repeat
The value of tCounterA might look something like this:
tCounterA["Joe"][3]
["Julie"][4]
["Rick"][8]
After the rework on the API, we needed to come back an update the docs to explain how to use this API.
https://docs.livecloud.io/List/
This API is unique in that it does not return an array. It is instead a very simple line delimited string. You might find this useful for getting all the recordIDs of a table. Or, you may store data that is used to build text in your UI. The output of this API could be directed to the text of the control without any cleaning. You may want to sort the data if that is important.
It could also be used to count duplicate values. Build an array from the list and have an accurate count of how many of a given value are duplicates.
--GET LIST OF FIRST NAMES IN TABLE Customers
--ACCESS DATA IN THE CLOUD
--FROM THE KEY firstName
put cdb_list("Customers","cloud","firstName") into tOutput
--REPEAT THROUGH THE STRING AND COUNT EACH NAME
repeat for each line xLine in tOutput
add 1 to tCounterA[xLine]
end repeat
The value of tCounterA might look something like this:
tCounterA["Joe"][3]
["Julie"][4]
["Rick"][8]