Is there any way to hide a control if a control inside a repeater is selected? , I can hide it if a =="Nurse" but if I add another row and select "diet" in that control, value of the control (displayed in a calculated value) now looks like "Nurse;Diet" and any additional rows just add to that. I want to hide a control if Nurse is selected in any of those but I'm not really seeing a way to do so. Any ideas?
Solved! Go to Solution.
I assume that you want to hide a Control outside of a Repeating Section, but use the controls that are inside of a Repeating Section to base your arguments off of. yes?
If that's the case, then using the following code in a Formatting Rule should accomplish what you're trying to do:
var matchExp = new RegExp(valueToHideOn, "gi");
return controlValue.match(matchExp) !== null;
}).length > 0;
Note: Because I have used .match() instead of just testing for equality, this isn't a particularly strict rule. If you require it to be more strict, or you have a word appear as a substring to one of the values being processed, then it might be better to use:
valueToHideOn = valueToHideOn.toLowerCase();
return controlValue.toLowerCase() === valueToHideOn;
}).length > 0;
Does this help you to solve your problem?
You can add a hidden calculated value inside repeating section and set value = "1" if a == "Nurse" and "0" if a != "Nurse".
Let's suppose that the name of the control is X.
Then add a calculated value named Y outside repeating section with formula = Sum(X).
Now if Y > 0 then hide your control.
Yo N J, are you trying to hide a control that is outside of the repeating section based on the selections made of controls that are inside the repeating section?
Does this rule do what you're trying to do?
Can you include a screenshot to maybe help me understand if I have it wrong?
I promise I'm not ignoring you! I was looking over your post as you posted your second one
I'll be honest, I tried the others first because they were a little quicker to attempt haha.
You're correct, I'm trying to hide controls outside of the repeater, based off a list lookup control inside the repeater.
After seeing Marian's rule, and now knowing what you're working with, I'd just use a modified version of:
or, for a visual: