Hi, I am wanting to ensure users are entering their data only while logged into their own account, and not someone elses.
I have a username field to pull the username (field 'USERNAME'). I have a select_one field ('SUBMITTER') of the list of usernames, for the submitter to select their own name from.
I'm wanting to set the constraint of SUBMITTER field so that the survey cannot be submitted unless the values of the SUBMITTER and USERNAME match. I thought the answer would be to set a constraint like .=${USERNAME} for the SUBMITTER field, but I get a constraint message regardless of whether the two field values match or not (the choices list names and labels for the SUBMITTER field is in the same format as the USERNAME value automatically pulled from the fieldtype username). What is the correct syntax I should be using?
In addition to this, I would like to set up a warning in case of the fields not matching, so that the submitters find out about the constraint early on, and not at the end of the survey. Since the only way to meet the constraint is to log out and log back in as themselves, they would lose all the survey answers if they find the error at the end of the survey which is the only time the constraint message comes up. One option I found is to create a note field with a warning, and set the relevance so that the warning note only comes up when the two above fields DON'T match. What is the correct syntax for the relevant field for this?
Solved! Go to Solution.
Are you sure the list matches the username exactly? Display it to make sure.
This works fine for me. Using a note with a relevant on it. I use this for inline warnings a lot.
Hope that helps
Are you sure the list matches the username exactly? Display it to make sure.
This works fine for me. Using a note with a relevant on it. I use this for inline warnings a lot.
Hope that helps
Hi Doug,
Perfect, thank you for that! The values were definitely matching and I thought that was the correct syntax, so not sure why I was getting errors inconsistently yesterday. And the syntax for relevant is really helpful, thank you! 🙂