Accessing the answers from a custom form using keywords

(Tim) #1

Matrix Version:
Has anyone every successfully got the values of answers from a custom form to display on a standard page of a website?

I have a custom form set up and working and I can use keywords to show answers on the thank you page.
I’d like some of the answers to show on other pages of the site - assuming the end user is in the same session and does not close the browser.

I’ve tried a number of variations of keywords but so far I’ve been unable to successfully get the answers to display on other standard pages.

Another option would be to somehow mirror the answers into metadata fields of a new asset and then use the metadata keywords. So the process would be: a new form is submitted, a new asset is created using a particular schema, then each field is populated with the respective answers from the form that was just submitted.

If that’s too hard I could rebuild the custom form as an asset builder but then I’d lose some of the nice features of the custom form eg incomplete submissions, sticky answers, multi-page set up etc

(John gill) #2

I’ve worked with submission assets a fair bit, and I would be astonished if this were possible. To the best of my knowledge, once the form is submitted and the thank you page has been served, there is no link between the current session and the submission asset that you could use to safely access those answers.

Putting the answers onto an asset could work, but you’d still have the obstacle of controlling access to them with permissions. If the user is just “public_user” then I don’t imagine this would be safe. Asset builder would have the same issue, it would likely only be possible safely for logged in users.

(Tim) #3

Hi John
thanks very much for your response.
Yes - you are correct.
One option I thought of is to not allow the full submission which would save the answers (but that’s probably not the best option).
The users will be logged in with Matrix user accounts so I’ll give the asset builder a go.
Thanks again

(John gill) #4

Stopping short of submission is a brilliant hack, but yeah it’d be hard to know what side effects that might have.

If you’re dealing with logged in users you might not even need the Asset Builder. When a logged in user submits a form they are granted write permission on the form_submission asset. A carefully crafted Asset Listing Page that lists the submission location and is restricted to only show things that the current user as write access to could be made to show “The most recent submission by whoever is viewing it”. Inside an Asset Listing Type Format the keywords like %question_answer_867530_q9% work just fine.

(Pawel Masloch) #5


You can store forms’ value(s) in global variables e.g.: %globals_post_#%; where # = form’s field name attribute OR %response_ASSET-NR_qID%, which is your input/select field’s native mapping. And you can pass them in ‘Additional GET parameters’ and print your values using Asset listing or query DBs, etc… Needless to say, the asset listing can be nested anywhere you wish to show the data.

You can also take advantage of ‘Confirmation Page Contents’ keywords like %form_summary% || %form_summary_html% || %form_summary_semantic% || %form_info% - to show what had been submitted so far on a result page of your form.

Now, how exactly you want to achieve that, will depend on your form set up and objectives.

Hope it helps.

(Tim) #6

Hi Pawel - that’s awesome
thanks so much

(Jane Butler) #7

We publish form submissions on a separate page of our website for our consultations. We publish the submissions for resource consent applications after they have been submitted. We don’t publish all the form fields for privacy purposes so we had a page created for us by the Squiz folk in Wellington and just clone the asset and updated asset id numbers for each form we want to publish.