I have a text entry question wherein I ask participants "What is your first name?"
I want to take their answer and store it as an embedded data field.
If someone inputs their first name (e.g., "Ayanna" or "Will"), things work perfectly! I use Survey Flow to set embedded data from their input.
The problem is that some people are inputting their names badly:
- Not capitalizing the first initial: "joe"
- Capitalizing every letter: "JOE"
- Including a last initial: "Joe T" or "Joe T."
- Including a last initial as one word: "JoeT"
- Weird typos: ", Joe"
Question: How do I take people's text input and standardize the format--capitalized first letter, just 1 word, nothing extraneous--and save it as an embedded data?
I think this will somehow require JavaScript, but I'm not sure (a) how to do this (I think it involves regular expressions? Qualtrics.Survey.Engine.set.embedded.data?), or even (b) where I would implement this (survey flow? question javascript?).
*I'm so grateful for any guidance you might have!*