Checking if a 'ChoiceTextEntryValue' contains a sub-string (a phrase) | XM Community
Skip to main content
Question

Checking if a 'ChoiceTextEntryValue' contains a sub-string (a phrase)

  • July 24, 2020
  • 5 replies
  • 122 views

Forum|alt.badge.img

My survey has a text input box which is stored into variable ${q://QID16/ChoiceTextEntryValue}
The survey needs to check if the text contains a phrase (sub-string?): "incorrect year level".
Can it be achieved without JS?
If not, what will be the JS code?
Thanks!


5 replies

rondev
Level 6 ●●●●●●
Forum|alt.badge.img+22
  • Level 6 ●●●●●●
  • July 24, 2020

We can use branch logic, with "is contains" condition


Forum|alt.badge.img
  • Author
  • Level 1 ●
  • July 24, 2020

Will it reliably (or at all) work for a string ?


Forum|alt.badge.img
  • Author
  • Level 1 ●
  • July 24, 2020

I mean a sub-string in the text


Forum|alt.badge.img
  • Author
  • Level 1 ●
  • July 25, 2020

When putting a string ""incorrect year level" into "contains" condition, do I need to use double quotes or single quotes or no quotes at all?


Forum|alt.badge.img
  • Author
  • Level 1 ●
  • July 25, 2020