Embedded data from 1st survey stored as embedded data in 2nd survey for use as piped text | XM Community
Skip to main content

I’ve looked through a lot of other posts where I think folks are trying to achieve something similar but I’m not sure if there’s a different way to do this because my scenario is going to have a lot of pieces of data to pass from the first survey to the second.

I’m building a survey for employees to upload files (pictures) and a second survey where, ideally, I can bring in the URL for those pictures from the first survey as embedded data that I can pipe in to an <img> tag so that the images can be voted on for a particular category.

In the first survey, I’ve set up a quota and logic to store each file as a separate piece of embedded data, so that I could use survey logic in the second survey how many radio options to display images for. And I’ve figured out how to pipe and image URL into a radio option.

But I haven’t figured out how to get the file URL as embedded data from the first survey into the embedded data in the second survey so that it can be piped text in a multiple choice question. Ideally, I don’t want this to be manual, although, there may not be a way around that. There could be up to 30 or more images submitted per category and we have 6 different categories. So I didn’t see how trying to pass this via URL Query Strings would be manageable. 

I thought could somehow I run a workflow to store the data in an imported data project then extract it, but I couldn’t get that to work, if it’s even possible. I thought maybe supplemental data source but that’s a manual upload.

Thanks in advance for any creative ideas!

Hi courtrc,

 

Instead of passing actual images url, I would suggest to create the multi select question at the end (before your survey redirect to another.)

 

Step 1: Create multi select question: Put options like, Image 1,Image 2, Image 3….image N and assign recodes as 1,2,3,4,5….

Step 2: Apply display logic on each option based on the image selection from previous logic

Step 3: Apply below JS in Javascript tab.

 

Qualtrics.SurveyEngine.addOnReady(function()
{
    /*Place your JavaScript here to run when the page is fully displayed*/
jQuery("#"+this.questionId).hide();
    jQuery("#"+this.questionId+" hchoiceid]").prop("checked",true);
     var qobj = this;
    qobj.clickNextButton();


});

 

Step 4: Create a hidden screen info with Q_CHL=preview display logic and pipe text  to check if it's punching correct options/images - e.g ${q://QID12/SelectedChoicesRecode} (change your question qid)

 

Step 5: Create embedded data and capture displayed or selected value of our above question e.g ${q://QID12/SelectedChoicesRecode}. Once done you can then pass the same variable via redirect or import that into second qualtrics survey.

 

Step 6: In second survey create the same multi select question with exactly same recode values but this time with options as <img src="actual path”> vs Image1, Image2.. without any display logic.

And apply this javascript

 

Qualtrics.SurveyEngine.addOnReady(function()
{

var qobj = this;
        jQuery("#"+this.questionId).hide();
var eval = "${e://Field/DispCodes}";  //Update the name of your embedded var, also make sure there are no spaces after ",". It should have values like 2,3,4
var arr=eval.split(",");
var choice;
for(var i=0;i<arr.length;i++)
{
choice=arrli];
this.setChoiceValueByRecodeValue(choice, true);
}
        qobj.clickNextButton();
});

 

Put test info to see if it's working and use carry forward display items or selected(display is preferred)


@faaiz.rahman Will something like this work if I’m not redirecting them immediately to another survey? In the first survey they submit their photos up until a deadline. Then once that’s complete, we’ll open up the second survey for everyone to vote.


Hi,

 

You can either redirect them immediately or need to upload their response in second survey whenever you want and share unique link with respondents otherwise we will not able to map what images particular respondent have selected in the first survey.


@faaiz.rahman Thanks for your initial response! Appreciate it. I think I’ll just have to do the upload option given the delay in the second survey. 


You're most welcome!

Please follow the steps above and it should work. You can test by uploading some test data.


Leave a Reply