Carry forward text entry using display logic | XM Community
Skip to main content

Hello!

I have a side-by-side question where each statement has a text entry box where respondents will input a name. I then have several columns with dropdown questions. One of the options from one of these dropdown questions is “Other”, which I have a follow up question for that asks for clarification.

I am trying to have the text entry for the names carry forward into the follow up side-by-side question but I only want the names for which this “Other” option was selected to carry forward. I can’t seem to get this to work as I either have all text entries carry forward or I have only the statement where “Other” was selected come up but that doesn’t carry forward the text (i.e. the text box is blank and respondents would have to input names again).

Does anyone know whether what I am trying to do is even possible?

Thank you in advance!

Hi!

What you’re trying to do is possible through a workaround that involve a bit of JavaScript, embedded data, and display logic.
 

Step 1: Collect data in your first Side-by-Side question
    •    Column 1: Text Entry (e.g., Name)
    •    Column 2: Dropdown (with “Other” as one of the choices)

Step 2: Use JavaScript to store names conditionally
In the next block (or in the page header/footer), run a script that:
    •    Checks which dropdowns had “Other” selected
    •    Stores only those names into embedded data variables like CarryName1, CarryName2, etc.

Qualtrics.SurveyEngine.addOnload(function() {
for (let i = 1; i <= 5; i++) { // adjust this number based on your row count
let name = "${q://QID1/Choice" + i + "_1}";
let choice = "${q://QID1/Choice" + i + "_2}";
if (choice === "Other") {
Qualtrics.SurveyEngine.setEmbeddedData("CarryName" + i, name);
}
}
});

Step 3: In your follow-up question
    •    Use piped text like ${e://Field/CarryName1} to display the name
    •    Add display logic: only show if CarryName1 is not empty

That way, only names where “Other” was selected show up, and the respondent doesn’t have to retype anything.


If you’re open to changing the question format, a Loop & Merge setup might be cleaner. You can loop through only those rows where “Other” was selected, carry the text entry using piped text, and ask your follow-up per name.
 

Cheers,
Rochak


Hi,

Assuming you want to go from this:

to this:

You can configure your SBS questions like this (select the right piped text inputs for your SBS 2 question):

With a choices display logic similar to this on you SBS 2 question:

 


Thank you both, both of these solutions worked perfectly!!