• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Query Builder and Code Snippet
#1
Hi everyone,

We've received a few questions regarding query. This video shows how you can use the query builder and code snippet to build a query and generate the code needed to perform the query: https://youtu.be/6g2pFEvdLcc

You can then take the code from the code snippet and use the output of the query to generate a list of names as follows:

Code:
local tInputA, tOutputA, tList

put cdb_query("trip","=","trip1","testTable","cloud","recordData") into tOutputA

//EACH KEY OF tOutputA CONTAINS THE recordID OF A RECORD THAT MATCHES THE QUERY CRITERIA
//WE REPEAT THROUGH EACH KEY TO ACCESS THE DATA IN EACH RECORD
repeat for each key xRecordID in tOutputA
    //GRAB THE NAME OF THE PERSON IN THIS RECORD TO CREATE A LIST
    put tOutputA[xRecordID]["person"] & lf after tList
end repeat

//DELETE TRAILING LF
delete char -1 of tList

We hope examples like this with short videos will be helpful. Let us know if there's a topic you would like us to cover.
  Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)