Set condition based on value not label | XM Community
Skip to main content
Solved

Set condition based on value not label

  • March 4, 2024
  • 2 replies
  • 45 views

Forum|alt.badge.img+3

Hello,

 

I currently have a conditional script that checks if “Yes” was selected at QID1. Could anyone advise how to rewrite the script to instead check for the value of ‘1’ (where 1=Yes)?

i.e. change...

if ("${q://QID1/ChoiceGroup/SelectedChoices}" === "Yes") 

to something like...

if ("${q://QID1/ChoiceGroup/SelectedValue}" === ‘1’) 

 

Just don’t know what the right reference would be.

Thanks

Best answer by Sachin Nandikol

Hello @cgillon

You can utilize the 'Selected Choice Recode' feature here. It will be represented by a code similar to this: '${q://QID2/SelectedChoicesRecode}'.

 

Let me know if this helps.

2 replies

Sachin Nandikol
QPN Level 6 ●●●●●●
Forum|alt.badge.img+44
  • QPN Level 6 ●●●●●●
  • Answer
  • March 4, 2024

Hello @cgillon

You can utilize the 'Selected Choice Recode' feature here. It will be represented by a code similar to this: '${q://QID2/SelectedChoicesRecode}'.

 

Let me know if this helps.


Forum|alt.badge.img+3
  • Author
  • Level 2 ●●
  • March 5, 2024

That works great.

Thanks for the assistance.