For the key and company fields I pass in $_POST variables. For q, a, and index I need to be able to query a “question” table that has q, a, and question_id as values. Query response is 1…n records per company.
How do I dynamically create this list of question, answers and index and pass this json data to a server side submit request / action? Thanks for the thoughts, help and suggestions.
Hi, I'm not sure if this will help but there could be some info there for you.
Basically any server connect file creates a JSON output that can be used like an API, but this trick above is what I needed to do to be able to use the data properly when using the data through a URL.
Useful to know if you don't already, even if it doesn't help here.
Thanks Phillip_J, this led me in the right direction. I didn’t realize that the output of the query was native json that could be subsequently referenced.
Here is what I did to get this to work.
For some reason my query was not populating in wappler, I validated data existed in MySQL and I think it was some combination of naming the query and how I was referencing it. (Started over and left the default names)
Created a new database query, with the default naming query1
Used the alias table to ensure that the naming matched what my API was looking for, question_id -> index
I no longer needed a repeat step as I thought I would need to build the string. I was able to reference {{query1}} as the input for the nested json string instead.