Custom Form Submission Action and Call Rest Resource question


(Alderman) #1

Can I use a custom form to construct different end parts of a REST URL in the submissions action by furnishing the base part of the url as text in the action and having keyword replacements of the fields a user fills in as the variable part of the URL?

 

If so - when the rest resource is called on submit how would I use the returned JSON (which is what it will be in this instance)?

 

Or am I completely off track with this (not unusual for me)

 

:-)

 

Cheers.

 

Jeff.


(Bart Banda) #2

hi Jeff, you sure can.

 

You can use either the response keywords of the form such as %response_<parent_id>_<question_id>% or use %globals_post_<post_var>%.

 

If you are using Matrix 5.1, you can put the returned JSON into a session var and/or process some JS on it as well.

 

If you are not, you could try and nest in a REST JS asset on the thank you page of the form to do the same thing effectively. 


(Alderman) #3

Thanks Bart that's a great help.