Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I need to write this into a variable but having some issues. Tried to replace the $-sign with chr(36) but could not get it to work:
only({<[User NT Name]={'$(=OSUser())'}>} [User Role])
Tried this:
Set vNavMenuTotAccess = =if(only({<[User NT Name]={'& chr(36) &(=OSUser())'}>} [User Role])='TOTAL_ACCESS',1,0);
Thanks
Zag
Hi,
It seems that some quotes are missing, try this:
LET vNavMenuTotAccess = '=if(only({<[User NT Name]={'& chr(39) & chr(36) &'(=OSUser())'& chr(39) &'}>} [User Role])='& chr(39) &'TOTAL_ACCESS'& chr(39) &',1,0)';
regards,
Vincent
If you do a:
Concat( {<[User NT Name]={'$(=OSUser())'}>} [User Role] , ' / ' )
In a Text Box or an Input Box ... do you get any values at all or several?
Hi,
I think NTNAME and OSName() values are in different format. OSUser() will return in DomainName\UserID format. Check once both NTNAME and OSName() are in same format.
Hope this helps you.
Regards,
Jagan.
Hi,
It seems that some quotes are missing, try this:
LET vNavMenuTotAccess = '=if(only({<[User NT Name]={'& chr(39) & chr(36) &'(=OSUser())'& chr(39) &'}>} [User Role])='& chr(39) &'TOTAL_ACCESS'& chr(39) &',1,0)';
regards,
Vincent
You are mixing up Set and Let a little here. Let will evaluate the expression, whereas Set takes it literally, so Set does not interpret chr(39) as a $ sign. I assume what you are trying to do is defer the $ expansion. I break between the $ and the open parenthesis will prevent the $ expansion, as will chr(39) in a Let statement.
This should work:
Let vNavMenuTotAccess = '=if(only({<[User NT Name]={"$' & '(=OSUser())"}>} [User Role]) = ''TOTAL_ACCESS'', 1, 0)';
Note the quotes around TOTAL ACCESS are each a pair of single quotes to escape the single quote inside the Let statement.
Or you can do it this way:
Set vNavMenuTotAccess = =if(only({<[User NT Name]={"#(=OSUser())"}>} [User Role]) = 'TOTAL_ACCESS', 1, 0);
Let vNavMenuTotAccess = Replace(vNavMenuTotAccess, '#', '$');
Its a little easier to check the quotes and parentheses if you replace the $ with another character and then place the $ in the following Let.
Awesome - thanks so much!
Thanks!