Skip to main content
Announcements
Global Transformation Awards! Applications are now open. Submit Entry
cancel
Showing results for 
Search instead for 
Did you mean: 
zagzebski
Creator
Creator

Creating variable, replacing Dollar $

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

1 Solution

Accepted Solutions
vincent_ardiet
Specialist
Specialist

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

View solution in original post

7 Replies
petter
Partner - Champion III
Partner - Champion III

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?

jagan
Luminary Alumni
Luminary Alumni

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.

vincent_ardiet
Specialist
Specialist

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

jonathandienst
Partner - Champion III
Partner - Champion III

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.

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
jonathandienst
Partner - Champion III
Partner - Champion III

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.

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
zagzebski
Creator
Creator
Author

Awesome - thanks so much!

zagzebski
Creator
Creator
Author

Thanks!