Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I am using the OSUser() function to determine whether a user can see specific objects in my QV app. I have an inline script loading a field called SupervisorNTName which contains the AD account names for Supervisors that I want to be able to see specific objects, whereas others cannot.
How can I write a conditional statement that checks whether the current OSUser() value exists within the SupervisorNTName column?
Thanks,
Sal
Something like the following should work:
if(match(OSUser(), $(=concat(distinct chr(39) & SupervisorNTName & chr(39),','))), 1, 0)
Explanation: match() checks if OSUser() is in any of the values returned by the concat() function.
Hi Nicole,
How can I modify that expression to work regardless of what values are selected for SupervisorNTName?
You can add a 1 to the set analysis to tell it to ignore all selections:
if(match(OSUser(), $(=concat({1}distinct chr(39) & SupervisorNTName & chr(39),','))), 1, 0)
I just did something very similar, there is a simple way to check if value exists in a field or not, FieldIndex(OSUser, SupervisorNTName), if exists, it returns the load order, else returns 0. You may need to remove the domain from OSUser().