Constraint if statement with two select multiple questions

503
5
Jump to solution
03-17-2022 02:48 PM
BradenWarns
New Contributor III

Hello,

I am having trouble with creating an IF statement with two select multiple questions in the constraint field.

Here is what I need to happen:20220316_141750.jpg

 

Here is what I have for the if statement:

if(selected(${extrarequest}, 'Extra_96g_Garbage'), 'One_time_fee' and 'Monthly_fee',
if(selected(${extrarequest}, 'Extra_96g_Recycle'), 'No_fee',
if(selected(${extrarequest}, 'Extra_96g_Garbage') and selected(${extrarequest}, 'Extra_96g_Recycle'), 'One_time_fee' and 'Monthly_fee' and 'No_fee',
'Remove_Recycle')))

I don't get any errors however, the constraint is not wrong correctly. I am sure I am missing something.

Any help would be greatly appreciated! @JamesTedrick    

 

0 Kudos
1 Solution

Accepted Solutions
BradenWarns
New Contributor III

I decided to change this section. I broke up the second multiple questions into single questions. Then used a simple selected function in the relevant field. Much easier to work with. Thanks for your help @Katherine_Clark

View solution in original post

0 Kudos
5 Replies
Katherine_Clark
MVP Regular Contributor

So, I'm not completely sure without testing it myself, but I believe select_multiple questions store the answer as a string, separated by commas. So instead of 'One_time_fee' and 'Monthly_fee', it would be 'One_time_fee, Monthly_fee'.

Best,
Katherine
0 Kudos
BradenWarns
New Contributor III

I tried your suggestion. I did not get an error, but it still is not functioning correctly. Thanks.

0 Kudos
Katherine_Clark
MVP Regular Contributor

Would you be able to share your XLS form? 

Best,
Katherine
0 Kudos
BradenWarns
New Contributor III

I decided to change this section. I broke up the second multiple questions into single questions. Then used a simple selected function in the relevant field. Much easier to work with. Thanks for your help @Katherine_Clark

0 Kudos
Katherine_Clark
MVP Regular Contributor

Happy to hear you found a workaround! 

Best,
Katherine
0 Kudos