Help with Constant Sum | XM Community
Skip to main content

I am trying to create almost like an Order Quote with Qualtrics and am stuck on figuring out a way to display the inputted values from a Constant Sum question. I am trying to take those inputted values (not the Total) and display them at the end of the survey. The values are used for “Quantity” of a product and I want to display them for the customer at the end.

Hi,

As far as i understand you want to embedded the Constant Sum question values in the end of survey. If so you can simply pipe in the value

 

 
 

Since my Constant Sum question is a “Carry Forward...” statement it doesn’t give me an option to pipe just the values for some reason. It only allows me to utilize the Total or the Highest or Lowest value.


Since my Constant Sum question is a “Carry Forward...” statement it doesn’t give me an option to pipe just the values for some reason. It only allows me to utilize the Total or the Highest or Lowest value.

You can pipe the values from the Constant Sum.  When you pipe, select the question then the row label (immediately after the ‘row label - Description). The pipe will look something like: ${q://QIDnn/ChoiceNumericEntryValue/x1}


Since my Constant Sum question is a “Carry Forward...” statement it doesn’t give me an option to pipe just the values for some reason. It only allows me to utilize the Total or the Highest or Lowest value.

You can pipe the values from the Constant Sum.  When you pipe, select the question then the row label (immediately after the ‘row label - Description). The pipe will look something like: ${q://QIDnn/ChoiceNumericEntryValue/x1}

That works, the issue I have is since I have 31 possible answers I technically add all 31 piped answers. Is there a way to remove the null values so that there isn’t a bunch of extra spacing in my message?


That works, the issue I have is since I have 31 possible answers I technically add all 31 piped answers. Is there a way to remove the null values so that there isn’t a bunch of extra spacing in my message?

You can use JavaScript to modify the format of the piped results. You’ll want to format your message so that all the piped values are inside an element (probably <span> or <td>) with the same class name so you can find them.


That works, the issue I have is since I have 31 possible answers I technically add all 31 piped answers. Is there a way to remove the null values so that there isn’t a bunch of extra spacing in my message?

You can use JavaScript to modify the format of the piped results. You’ll want to format your message so that all the piped values are inside an element (probably <span> or <td>) with the same class name so you can find them.

I am still kinda a novice at Qualtrics, how would I go about doing this? I have added javascript to a Question before, but not applying it to Piped Text etc. Thanks


I am still kinda a novice at Qualtrics, how would I go about doing this? I have added javascript to a Question before, but not applying it to Piped Text etc. Thanks

Let’s say you’ve piped the results into a table with 31 rows. You would have cells like this:

<td class="cspipe">${q://QID1/ChoiceNumericEntryValue/x1}</td>

To hide the rows with blank pipes:

jQuery("#"+this.questionId+" .cspipe").each(function() {
var cspipe = jQuery(this);
if(cspipe.text()=="") cspipe.parent().hide();
});

In this example the parent is a table row. However, I’ve written it so it would apply to any type of parent/child element relationship (e.g., <tr><td>, <div><span>, <li><span>, etc.).


I am still kinda a novice at Qualtrics, how would I go about doing this? I have added javascript to a Question before, but not applying it to Piped Text etc. Thanks

Let’s say you’ve piped the results into a table with 31 rows. You would have cells like this:

<td class="cspipe">${q://QID1/ChoiceNumericEntryValue/x1}</td>

To hide the rows with blank pipes:

jQuery("#"+this.questionId+" .cspipe").each(function() {
var cspipe = jQuery(this);
if(cspipe.text()=="") cspipe.parent().hide();
});

In this example the parent is a table row. However, I’ve written it so it would apply to any type of parent/child element relationship (e.g., <tr><td>, <div><span>, <li><span>, etc.).

Ended up adding the JS to the template itself, Thanks so much Tom!


Leave a Reply