Announcing the Saviynt Knowledge Exchange unifying the Saviynt forums, documentation, training,
and more in a single search tool across platforms. Read the announcement here.

Unable to generate Account name rule generation logic

Bhargavi3
New Contributor III
New Contributor III

Hi Team,

We are trying to generate account name rule using if else condition. But it is not working. The below one was provided in document and it is working fine. If I update with my logic it is not working.

In Document:

concat(users.firstname, users.city, (case when (users.lastname = 'Admin')
THEN
concat(users.firstname,users.location)
ELSE
users.lastname
END))

My Logic:

concat(user.country,user.location,user.firstname,user.lastname,user.customproperty40,
(case when
(user.comments = 'Workday Imported')
THEN
Concat(LOWER(SUBSTRING(user.country, 1, 1)),
LOWER(user.location),
LOWER(SUBSTRING(user.firstname, 1, 1)),
LOWER(SUBSTRING(user.lastname, 1, 2)),
LOWER(SUBSTRING(user.customproperty40, LENGTH(user.customproperty40) - 1, 1))
)))ELSE
CONCAT(user.firstname,user.lastname,(case when (user.employeeType = 'Call Center' AND user.location = 'Malaysia') THEN
CONCAT(
'cctd',
LOWER(SUBSTRING(user.firstname, 1, 4)),
LOWER(SUBSTRING(user.lastname, 3, 1))
END)))

Could someone help me to correct the query?

Thanks,

Bhargavi Padaraju.

 

3 REPLIES 3

SumathiSomala
All-Star
All-Star

@Bhargavi3 Use users. instead of user

example: users.country

First to troubleshoot try with simple query ,then add conditions.

Regards,
Sumathi Somala
If this reply answered your question, please Accept As Solution and give Kudos.

Bhargavi3
New Contributor III
New Contributor III

@SumathiSomala , Thanks for the reply.

Yes, I tested with users also did not work.

CONCAT( COALESCE(user.country, ''), COALESCE(user.location, ''), COALESCE(user.firstname, ''), COALESCE(user.lastname, ''), COALESCE(user.customproperty40, ''), (CASE WHEN user.comments = 'Workday Imported' THEN CONCAT( LOWER(SUBSTRING(COALESCE(user.country, ''), 1, 1)), LOWER(COALESCE(user.location, '')), LOWER(SUBSTRING(COALESCE(user.firstname, ''), 1, 1)), LOWER(SUBSTRING(COALESCE(user.lastname, ''), 1, 2)), LOWER(SUBSTRING(COALESCE(user.customproperty40, ''), LENGTH(COALESCE(user.customproperty40, '')) - 1, 1)) ) ELSE CONCAT( COALESCE(user.firstname, ''), COALESCE(user.lastname, ''), (CASE WHEN user.employeeType = 'Call Center' AND user.location = 'Malaysia' THEN CONCAT( 'cctd', LOWER(SUBSTRING(COALESCE(user.firstname, ''), 1, 4)), LOWER(SUBSTRING(COALESCE(user.lastname, ''), 3, 1)) ) ELSE '' END) ) END) )


Regards,
Rushikesh Vartak
If you find this response useful, kindly consider selecting 'Accept As Solution' and clicking on the 'Kudos' button.