My survey is using a login/password action to prepopulate hidden questions with uploaded data. In my case, the “passwords” are not unique to the respondent, and someone may want to change their password while editing their response or by clicking “Back” to a previous page.
My question is, how can I update the prepopulated fields to reflect a changed “password”? The prepopulation will re-run if I manually remove the prepopulated answer before returning to the password page, so I tried to replicate that action in custom scripting (i.e. before running the login/password action, set the value of the questions to be populated on the next page to be blank). That didn’t work as the questions that should have been prepopulated remain blank.
Any ideas on how this could be accomplished?
I actually just emailed support about this same issue, they said that the prepopulated fields will not pre-populate I there is already a value in the place they are trying to populate.
I was able to get it to work using custom scripting. When you said that you set them to be blank in your script, did you use blank text…or did you actually set them to be null? Blank text would be a value, so that would stop the prefill. Make sure you set to null.
Note (250 and 250 are the question IDs of the items I am clearing).
Just make sure this script is run prior to the login action (place it on the same page as the login action, or on a prior page that anyone who edits their password will hit).
If that doesn’t work, I actually use a script that checks to see if a question that feeds into the login action is answered (at page load), and if it is, then it sets the values pre-populated values to null. I don’t think you need to get that complicated based on your description – but if you do, here is the script. I place this on the page where the feeder questions are answered.
If (sgapiIsAnswered (247))