Keywords for post variables in custom form SQL query action


(Sam Bondareff) #1

Hi, I am developing a voting application built-in Vuejs and it is embedded into a squiz standard page. The premise of the application is to make 5 selections and then place those selections as a vote via a custom form. I have all of this working by posting the vote to a squiz custom form via Vuejs, squiz is recording the votes and I can see them in submission logs as expected.

I would also like to post the results to a MySQL DB, I have SQL query set up as an action on the form, this action fires off when a vote is recorded but for whatever reasons the values from posts are not being parsed on the sql query. I have tried multiple permutations of what I have researched on the online docs and the forums but nothing is parsing in the SQL query. Below is an example of some tags that I tried.

%globals_post_XXX_q1%
%globals_post_variablename%
%globals_post^index:variablename%

What should I be using to convert my post variables to successfully parse in the SQL query? Any help appreciated.

Matrix Version: 5.5.2.0


(Sam Bondareff) #2

Has anybody come across this situation?


(Robin Bilney) #3

What about the %response_<parent_id>_<question_id>% keyword?


(Sam Bondareff) #4

Hi Robin thanks for the reply, I have tried that as well, sorry I forgot to put that in my initial post. I get a value like “:response_1” in the database when I use that keyword. Weird thing is that if output the values of post in an email body I get the required values. I know it must be something simple that I am missing.


(Bart Banda) #5

That’s weird. It definitely works if you hardcode the values into the SQL query?

I wonder why it’s interpreting “%response_100_q1%” as “:response_1”, clearly the keyword isn’t getting parsed.

Are there any errors in the error log?

Can you share the SQL query you are using?