Expand my Community achievements bar.

SOLVED

Dynamically populate the Survey questions based on a specific column in a schema ?

Avatar

Level 6

Hi everyone, 

Happy New Year!

I've set up a WebApp with the following flow: Preloading > Page > Storage > Thank You Page > End.

  1. In the survey section, there are three questions where participants are asked to rate various features on a scale of 1 to 10. I am looking for a way to dynamically adjust these features based on the information in each recipient's 'features_schema'.
  2. Also, I need to ensure that each participant can only submit their responses once. This is crucial for maintaining the integrity of the survey results.
  3. Furthermore, I aim to restrict access to the survey so that it's available only to the individuals who received it via email. This is to ensure that the feedback is gathered exclusively from the intended audience.

Also,the form we are using a custom form that has it's own HTML, CSS, Jquery & JS in it.

Please suggest. Thank you in advance. 

 

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi @rvnth,

 

1. You can store the set of questions in a custom schema, and link them to a 'feature' (or whatever terminology you have). In the webapp, when you are doing the preloading, you can get the linked information from your features schema. Based on that you can pull the required questions from the schema where you store all the questions, and display them on the page. Once the recipient fills and saves the survey, the records get saved in the responses schema, with a link to the recipient.

2. During preloading itself you can check whether a response from the recipient already exists in the responses table. If yes, you can route them directly to the thank you page and display a relevant message to them.

3. You can do so by implementing a condition on the webapp link that you have in your email such that a specific parameter gets added or omitted from the link whenever it is a forward. (There is a condition which checks the document mode in the mirror page personalization block, you can use that for your webapp link as well). 

if ( document.mode != 'mirror' && document.mode != 'forward' )

 Based on the presence/absence of that parameter you can grant/deny access to the survey questions page.

 

Regards,

Ishan

View solution in original post

2 Replies

Avatar

Correct answer by
Community Advisor

Hi @rvnth,

 

1. You can store the set of questions in a custom schema, and link them to a 'feature' (or whatever terminology you have). In the webapp, when you are doing the preloading, you can get the linked information from your features schema. Based on that you can pull the required questions from the schema where you store all the questions, and display them on the page. Once the recipient fills and saves the survey, the records get saved in the responses schema, with a link to the recipient.

2. During preloading itself you can check whether a response from the recipient already exists in the responses table. If yes, you can route them directly to the thank you page and display a relevant message to them.

3. You can do so by implementing a condition on the webapp link that you have in your email such that a specific parameter gets added or omitted from the link whenever it is a forward. (There is a condition which checks the document mode in the mirror page personalization block, you can use that for your webapp link as well). 

if ( document.mode != 'mirror' && document.mode != 'forward' )

 Based on the presence/absence of that parameter you can grant/deny access to the survey questions page.

 

Regards,

Ishan

Avatar

Level 6

Hi @isahore ,

 

Could you please provide further clarification on the suggestion you mentioned below:

  • You mentioned that it's possible to check during preloading whether a recipient's response already exists in the responses table. If a response is found, the recipient can be redirected to the thank you page with an appropriate message.

Currently, I am using a JavaScript activity and querying the schema with queryDef to check if the email address exists and whether there's already a value in the feature_1 column associated with it. However, I'm not certain if this is the right approach.

 

rvnth_0-1727697113077.png

 

Thank you in advance