Click HERE to see how Saviynt Intelligence is transforming the industry. |
09/26/2024 12:27 AM
Hi Team,
I have requirement. Below are the conditions
if users saviynt username starts with PR then the account name should be generated as domain\users.systemusername
if users saviynt username starts with pr then the account name should be generated as domain\users.systemusername.
Can someone help me with this? I dont have any example query at the moment. I am trying to handle this from account name rule in the endpoint
09/26/2024 12:42 AM
Hi @AadhithyanS please use the below query as an advanced config under endpoints account name rule. modify the query accordingly if required.
case when users.username LIKE 'PR%' then concat('domain\',users.systemusername) else users.systemusername end
Let me know if this helps!
09/26/2024 01:18 AM - edited 09/26/2024 01:19 AM
the above query is not working. here is what i get when i request from ARS.
Below is the screenshot from the endpoint
Also if you see my original question these are two different domains so write another concat? if so i tried it and it didn't work. below is the query
case when users.username LIKE 'PR%' then concat('domain1\',users.systemusername) else concat('domain2\',users.systemusername) end
Please can you help asap this is bit urgent
09/26/2024 01:36 AM
@AadhithyanS try this
case when users.username LIKE 'PR%' then concat('domain1\\',users.systemusername) else concat('domain2\\',users.systemusername) end
09/26/2024 02:15 AM - edited 09/26/2024 02:18 AM
Tried your query and it's working for only the first condition. so if the condition fails it still takes the first domain name and not going into the else condition. So i tried the below but still it's not working can you please advise
case when users.username like 'XX%' then concat('domain1\\',users.systemusername)
when users.username like 'xx%' then concat('domain2\\'users.systemusername) else end
Also is it possible to use startsWith?
09/26/2024 02:32 AM
Hi @AadhithyanS what is the difference between XX and xx value just the case of actually the value is different?
09/26/2024 02:35 AM
@NM it's just the case sensitive some have captial and some have lower case so based on this the domains gets assigned for capital domain1 and for lower domain2
09/26/2024 02:39 AM
@AadhithyanS i believe this is what is creating an issue .. can you try one thing .. instead of lower case use a entirely different and see what is shows.
09/26/2024 02:42 AM
@NM That would work but this is our scenario. for some users the saviynt username starts with XX and for some it starts with xx case sensitive again not different value. so based on this the domains are assigned like the above which i told.
09/26/2024 01:51 AM - edited 09/26/2024 01:51 AM
@AadhithyanS in the else part it should be users.systemusername
there is a typo in your query.
09/26/2024 12:51 AM
@AadhithyanS please add the symbol in special characters field
09/26/2024 03:22 AM
@NM any advice i have updated what i need above
09/26/2024 09:48 AM
CASE
WHEN ASCII(SUBSTRING(users.username, 1, 1)) BETWEEN 65 AND 90 THEN
CASE
WHEN users.username LIKE 'XX%' THEN CONCAT('domain1\\', users.systemusername)
WHEN users.username LIKE 'PR%' THEN CONCAT('domain\\', users.systemusername)
ELSE NULL
END
WHEN ASCII(SUBSTRING(users.username, 1, 1)) BETWEEN 97 AND 122 THEN
CASE
WHEN users.username LIKE 'xx%' THEN CONCAT('domain2\\', users.systemusername)
WHEN users.username LIKE 'pr%' THEN CONCAT('domain\\', users.systemusername)
ELSE NULL
END
ELSE NULL
END