Im trying to bucket multiple choice question to groups.
The standard bucketing feature converts it to single choice.
I tried to do branch logic but its only storing the last value captured like below
in the above case if the condition is valid for both it will store only the second value “outdoor patio experience”
Can you please help with it.
Kind regards,
Praveen
Best answer by praveengeorgeix
Hi Guys,
For multiple conditions we can use this javascript below to update the multi value set embedded data.
Im showing an example of 3 groupings here. You can add as many groups you want.
Qualtrics.SurveyEngine.addOnload(function() { /*Place your JavaScript here to run when the page loads*/
// Get the value of the TagExpType variable var tagExpType = "${e://Field/TagExpType}";
// Initialize the TagExpTypeRecoded variable var tagExpTypeRecoded = [];
// Check the value of TagExpType and concatenate true conditions into TagExpTypeRecoded if (tagExpType.includes("Club Member Exclusive Tables - Outdoor Patio") || tagExpType.includes("Outdoor Patio Experience Large Group") || tagExpType.includes("Outdoor Patio Sparkling Wine Tasting")) { tagExpTypeRecoded.push("Outdoor Patio Experience"); } if (tagExpType.includes("Devaux Lounge Tasting") || tagExpType.includes("Trade Visit")) { tagExpTypeRecoded.push("Tasting Room Experience"); } if (tagExpType.includes("Capturing the Sparkle Private Tour and Tasting")) { tagExpTypeRecoded.push("Tour"); } if (tagExpType.includes("VG Tasting") || tagExpType.includes("VG Tasting Club Comp") || tagExpType.includes("Vineyard Green Sparkling Wine Tasting")) { tagExpTypeRecoded.push("Vineyard Green Experience Seasonal"); }
// Join the elements of tagExpTypeRecoded array with comma and space var concatenatedTags = tagExpTypeRecoded.join(", ");
// Set the value of the TagExpTypeRecoded embedded data variable Qualtrics.SurveyEngine.setEmbeddedData('TagExpTypeRecoded', concatenatedTags); });
Hi @praveengeorgeix , Multi Value Text Set stores the each comma separated value separately but for that you need to assign those multiple values in the embedded data. Please refer below example image.
If option 1 is selected in Q1 then b=1 but if along with option 1 in Q1; option 1 in Q2 is selected then b=1,2 or else b=2. This is just for example, you can use your real values in it. This is how a multi value text set stores the values.Whereas a text set will store the value as a single entity i.e., “1,2”.
Looking at the Survey Flow you shared, it’s working as expected in Qualtrics. The first Set Embedded Data value assignment is being overwritten by the second one; It is not possible to automatically bucket the values assigned in different steps of the Survey Flow.
I think @omkarkewat is at the right track; you’ll have to set up a separate Branching and Embedded Data assignments for each possible combination of multi-text values. So, using the example in your screen shot, the Embedded Data would be like this.
Hi @praveengeorgeix thanks @MatthewM for providing a visual representation of what I am trying to say, I’ll more to it below.
@praveengeorgeix I tried to replicate your survey flow and you can add an extra condition (highlighted in yellow) with AND operator which will ensure that TagExpTypeMultiRecoded will capture both the values (Other and Outdoor Patio Experience) if it has a value already (Other).
I also took a test survey with the required query string and it works fine.
For multiple conditions we can use this javascript below to update the multi value set embedded data.
Im showing an example of 3 groupings here. You can add as many groups you want.
Qualtrics.SurveyEngine.addOnload(function() { /*Place your JavaScript here to run when the page loads*/
// Get the value of the TagExpType variable var tagExpType = "${e://Field/TagExpType}";
// Initialize the TagExpTypeRecoded variable var tagExpTypeRecoded = [];
// Check the value of TagExpType and concatenate true conditions into TagExpTypeRecoded if (tagExpType.includes("Club Member Exclusive Tables - Outdoor Patio") || tagExpType.includes("Outdoor Patio Experience Large Group") || tagExpType.includes("Outdoor Patio Sparkling Wine Tasting")) { tagExpTypeRecoded.push("Outdoor Patio Experience"); } if (tagExpType.includes("Devaux Lounge Tasting") || tagExpType.includes("Trade Visit")) { tagExpTypeRecoded.push("Tasting Room Experience"); } if (tagExpType.includes("Capturing the Sparkle Private Tour and Tasting")) { tagExpTypeRecoded.push("Tour"); } if (tagExpType.includes("VG Tasting") || tagExpType.includes("VG Tasting Club Comp") || tagExpType.includes("Vineyard Green Sparkling Wine Tasting")) { tagExpTypeRecoded.push("Vineyard Green Experience Seasonal"); }
// Join the elements of tagExpTypeRecoded array with comma and space var concatenatedTags = tagExpTypeRecoded.join(", ");
// Set the value of the TagExpTypeRecoded embedded data variable Qualtrics.SurveyEngine.setEmbeddedData('TagExpTypeRecoded', concatenatedTags); });