Set condition based on value not label | XM Community
Solved

Set condition based on value not label

  • 4 March 2024
  • 2 replies
  • 29 views

Badge +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

icon

Best answer by Sachin Nandikol 4 March 2024, 11:16

View original

2 replies

Userlevel 6
Badge +21

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.

Badge +3

That works great.

Thanks for the assistance.

Leave a Reply