Changing first letter of piped text to lowercase | XM Community
Skip to main content

I want to pipe the selection from a standard likert scale question like the one below into a follow-up open ended question.

  1. Very unlikely
  2. Somewhat unlikely
  3. Neither likely nor unlikely
  4. Somewhat likely
  5. Very likely

I want to change the first letter of the piped selection so that it is lower case.

The piping instruction I currently have in the open ended question is:
Why are you ${q://QID26/ChoiceGroup/SelectedChoices} to consider using... 

I tried using the tips noted in the thread below but it isn’t working for me.

 

I think the html was lost from that post when the Community platform changed.

Use this html in your question text:

Why are you <span style="text-transform:lowercase">${q://QID26/ChoiceGroup/SelectedChoices}</span> to consider using... 

 


Is it possible to do this for all answer options except one? I have the list below and would like to pipe the selection into the middle of the subsequent question text. The lowercase transformation would apply to all options except the brand name which should stay capitalized.

  1. A plumber
  2. A contractor
  3. A water cleanup/drying service
  4. ;BRAND]
  5. My insurance agent
  6. A friend or family member

Can I do this with html or do I need to set embed data to pipe instead?


@Regan,

In your MC question, put tBRAND] inside a span with capitalize:

<span style='text-transform:capitalize'>tBRAND]</span>

When piped this span’s style will take precedence over the span with the lowercase style.


Thanks, ​@TomG, this worked perfectly! I have a follow-up for the same question…

Answer choice 5 below doesn’t make sense when piped into the following question. To make sense the next needs to be “your insurance agent” when piped.

 

Q1  Which of the following best describes who you would contact first?

  1. A plumber
  2. A contractor
  3. A water cleanup/drying service
  4. rBRAND]
  5. My insurance agent OK HERE
  6. A friend or family member

 

Q2  Why would you contact ${q://QID9/ChoiceGroup/SelectedChoicesTextEntry} first? DOESN’T MAKE SENSE HERE; NEEDS TO BE “your insurance agent”

 

Is there a way to modify just this entry with JS and/or HTML? I would love to avoid creating embedded data fields since all the other options are working so well with tips you already provided.


Make the choice in Q1:

<span class="your">your</span> insurance agent

Add this JS to Q1:

Qualtrics.SurveyEngine.addOnload(function() {
this.getQuestionContainer().querySelector(".your").innerText = "My";
});

 


Thank you SO much!


Leave a Reply