Hi,
I'd like to return what wasn't selected from a select multiple question. I know i can do it by adding a hidden field and returning the False or No value to that field, but i have a lot of fields. Is there a way were i can do if count < #, return the choice that wasn't selected? I would think that it's possible, but not sure of the field/syntax to try it.
Anyone else attempt something similar?
TIA!
Sue
Solved! Go to Solution.
Sorry, I was a little sloppy on hte original function - that will be revised.
In the Red/Green/Blue example, the code would be:
concat(if(selected(${color}, 'red'),'','Red'),if(selected(${color}, 'green'),' ','Green '),if(selected(${color}, 'blue'),'','Blue'))
As you say, this generates a list (as there may be multiple values not selected). The if() statement checks for each value and places no string (or a space to preserve formatting for a middle value like green) if the value is selected and the text if the value is not selected.
Hi Sue,
As you say, you could do this with a concat() function joining separate if statements checking for the presence of a choice:
concat(if(selected(${q}, 'choiceA'), '','choiceA'), if(selected(${q},'choiceB'), '','choiceB'))
and so forth for each choice in the list.
Ed: revised function to be valid XLSForm
Sorry James, I'm not following exactly. Wouldn't this give me a list?
If i have a question that says Red, Green, Blue. Red and Green are checked, how do i get that the Blue wasn't?
Sorry, I was a little sloppy on hte original function - that will be revised.
In the Red/Green/Blue example, the code would be:
concat(if(selected(${color}, 'red'),'','Red'),if(selected(${color}, 'green'),' ','Green '),if(selected(${color}, 'blue'),'','Blue'))
As you say, this generates a list (as there may be multiple values not selected). The if() statement checks for each value and places no string (or a space to preserve formatting for a middle value like green) if the value is selected and the text if the value is not selected.
Ah, I get it now. And it works like a charm! Thanks so much James for you super quick and super helpful response!