Stripping first two characters from piped text ${q://QID18/ChoiceTextEntryValue} | XM Community
Skip to main content
Solved

Stripping first two characters from piped text ${q://QID18/ChoiceTextEntryValue}

  • September 3, 2019
  • 1 reply
  • 56 views

Forum|alt.badge.img
I insert piped text ${q://QID18/ChoiceTextEntryValue} into different other questions, use it in display logic, branching conditions as well as within email trigger. Now I need to insert text obtained from string ${q://QID18/ChoiceTextEntryValue} by removing the first two characters. For example, ${q://QID18/ChoiceTextEntryValue} is 'CP104A', then I need to be able to insert text '104A' into questions. Can it be achieved with RegEx expression? The original string ${q://QID18/ChoiceTextEntryValue} should not be changed. I am new to Qualtrics and not yet familiar with JavaScript. Thanks!

Best answer by KimothiSaurabh

I think there is no way to directly manipulate piped text so you can try below workaround. Put `<span class="trimT"></span>` where you want to pipe the text and then in javascript write below code:- var pText = "${q://QID18/ChoiceTextEntryValue}" jQuery('.trimT').html(pText.slice(2,pText.length));
View original

1 reply

Forum|alt.badge.img+18
  • Level 3 ●●●
  • 78 replies
  • Answer
  • September 3, 2019
I think there is no way to directly manipulate piped text so you can try below workaround. Put `<span class="trimT"></span>` where you want to pipe the text and then in javascript write below code:- var pText = "${q://QID18/ChoiceTextEntryValue}" jQuery('.trimT').html(pText.slice(2,pText.length));

Leave a Reply