store Filename and UniqueID uploaded file to Embbeded Data Field | XM Community
Skip to main content
In a survey I have an option to upload a file, in my case an image. Normaly I can create Embedded Data Fields to store the filename and URL to the Embedded Data Fields using ie ${q://QID1/UploadedFileName} for Filename and ${q://QID1/UploadedFileLink} for URL. However, this can only be stored to Embedded Data Fields when the Next-button is pressed.



Now I want the selected filename and URL be stored in Embedded Data Fields when I press the Back-button. I know how to store Text from Textfields, like:



Qualtrics.SurveyEngine.addOnPageSubmit(function() {

var answer = jQuery("#"+this.questionId+" .InputText").val();

Qualtrics.SurveyEngine.setEmbeddedData('MyText', answer);

});



The Embedded Data Field called 'MyText' wil contain the text wich is typed into the questions text field. What do I need to change in the jQuerystring (where I read .InputText' to get the text out of the textfield) to get the Filename and URL of an uploaded file?



Thanks in advance.
May I ask, why do you need a back button to begin with? Could you just do in-page display logic to show the upload file option when needed?
This is a bit complicated. Anyhow, I'm using the option 'Loop & Merge' in a second blok where in a first block I can choose out of 20 options. Each time when I choose an option, answer the questions (including the one with file upload) within this loop I want to go back in stead of futher. When I go back all answers are stored into Embedded Data Fields (using JavaScript) I'm having this page with 20 option in my screen. Now I can choose another option or I can quit this form. All given answers in either loop are then stored in a contactlist. An email is send to the respondent with a link to this form. Because I'm using External Data Reference which belongs to a specific respondent I can start the form again where at the start from this form first the contactlist is read and all Embedded Data Fields from the contactlist are prefilled into this new response.



I could not think of a better opion having respondens choose their own order in filling in the form.



Hopefully this is helpfull for answering my question and reason.

Leave a Reply