Anyway to set a field to accept unique entires only? | Experience Community
Skip to main content

Anyway to set a field to accept unique entires only?

  • Sep 15, 2022 3:39 PM UTC
  • 7 replies
  • 114 views

Forum|alt.badge.img+1

I'm trying to setup a survey and it collects a unique user ID as input from the user. Is there a way to validate this field to let the user continue only if that ID is new?
ps; I tried the contacts route, but seems like the subscription I have through our institute does not support it.
Thank you

7 replies

bgooldfed
Level 4 ●●●●
Forum|alt.badge.img+25
  • Level 4 ●●●●
  • Sep 15, 2022 11:29 PM UTC

Hi Cyril,
If you have access to the API, you can search for a contact using that information. If it returns 0 results, then you know the ID is unique.
Good luck!


Forum|alt.badge.img+1
  • Author
  • Sep 16, 2022 1:13 AM UTC

https://community.qualtrics.com/XMcommunity/discussion/comment/49595#Comment_49595Hi bgooldfed, I can't use the contact feature because our institution does not have access. Is there any other way to do this?
Looks like you don’t have permission to access the Qualtrics XM Directory. Please contact your organization's Qualtrics admin to gain access to XM Directory contacts.


bgooldfed
Level 4 ●●●●
Forum|alt.badge.img+25
  • Level 4 ●●●●
  • Sep 16, 2022 3:54 AM UTC


https://community.qualtrics.com/XMcommunity/discussion/comment/49598#Comment_49598My bad! It will be a bit trickier then. You will need some way to store/update unique IDs and then search them. Do you have access to create workflows and datasets? (You can find workflows in the dropdown menu, and datasets from Create project -> Imported Data). You might be able to use these to update a list of unique IDs every time the survey completes, and check against that list whenever somebody enters a unique ID during the survey.
If you don't have access to those, you'll need to store/update the IDs on an external database service with a REST API (eg: MongoDB, restDB) and then POST/GET information from the database during your survey via a Web Service (in the Survey Flow or with Javascript).
Obviously the former is a lot cleaner but may not work depending on your license.


Forum|alt.badge.img+1
  • Author
  • Sep 16, 2022 11:19 AM UTC

https://community.qualtrics.com/XMcommunity/discussion/comment/49599#Comment_49599Annoyingly the first method, I don't have access to datasets through the license we have. The workflow shows up but I can't create a data project. So I guess that is out. But I was trying out with workflow to save the data to a google sheet, and then to do a lookup from the google sheet. How can I do the data comparison though? As in retrieve the list when someone starts the survey for comparing?
For the second, I've been trying with this but seems like I'm missing something? https://community.qualtrics.com/XMcommunity/discussion/22320/using-web-service-as-a-unique-field-validation-where-is-it-going-wrong#latest


cphillipps
Level 2 ●●
Forum|alt.badge.img+7
  • Level 2 ●●
  • Sep 16, 2022 1:51 PM UTC

Would it be easier just to turn on the preventing multiple submissions feature? It sounds like this is going to be very complicated to set up with less return on your time.

https://www.qualtrics.com/support/survey-platform/survey-module/survey-options/survey-protection/#PreventingRespondentsFromTakingYourSurveyMoreThanOnce


Forum|alt.badge.img+1
  • Author
  • Sep 17, 2022 4:48 PM UTC

https://community.qualtrics.com/XMcommunity/discussion/comment/49616#Comment_49616I already have that enabled + workflow to exit when duplicates come in and still people can get through.


bgooldfed
Level 4 ●●●●
Forum|alt.badge.img+25
  • Level 4 ●●●●
  • Sep 19, 2022 12:28 AM UTC

https://community.qualtrics.com/XMcommunity/discussion/comment/49606#Comment_49606You can fetch the sheet for comparing using Google Apps Script API.
A nice summary I found on StackOverflow: https://stackoverflow.com/a/49550441
Note that if you'll be using an external library (like axios) you will need to import it in Qualtrics by adding it to the header.

I'm no good with PHP so can't help with your other thread :(