Has anyone been able to take an imported file (e.g., a list of contacts for distribution), convert a single field (e.g., email address) into an array that can then be used as part of a JavaScript code block within a single question? Thanks in advance for any help.
Page 1 / 1
Yeah, this is pretty simple.
In the contact list, concatenate the items in the field with something that isn't normally used, like a `~` or `;`:
`email1@test.com~email2@test.com~email3@test.com`
Then in the JS editor, get the field:
`var customEmails = Qualtrics.SurveyEngine.getEmbeddedData('custom_emails');`
Now split it into an array:
`var customEmailsArr = customEmails.split('~');`
Note that you may need to include the embedded data field in your survey flow for it to be accessible.
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.