I have a request Control in a workflow, that has 3 linked lookups. They are cascading lookups, i.e. the details are in a list and only show items relating to the previous lookup.
I want to have a validation rule on the lookups, the first 2 are easy as they always have values, but the 3rd lookup doesn't always have a value. is there a expression I can put in the rule that counts the number of items in the lookup?
The Named Control is called rootCauseSubCategory. I have put count n there, but I know it doesn't work as it counts the number of a repeated section.
Is there another function that will return the number of items in a lookup, so I can use a validation rule on the control?
there is no direct way how you could determine number of items in a lookup control.
but you can achieve that with a little trick using calculated value control.
set up calculated value control so that it looks up the same list as 3rd-level lookup control (L3_lookup in my example below) and let it filter by the same 2nd-level control as you filter 3rd-level lookup control (L2_lookup).
output of lookup function will be array of just the same items you get in 3rd-level lookup.
if you then calculate length of that array you will get number of items in 3rd-level lookup control
I am having the same kind of issue. below is the screen shot of my question:
Could you please help me to hide that lookup field (Corporatecard) when the drop down shows no value:
I have tried your formula mentioned here, but my calculated field shows 0 value, not sure why.