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

Auto Increment for Dynamic Attribute based on the existing value

jsatish
Regular Contributor
Regular Contributor

Hi Team,

Is there a possiblity to validate the existing account customproperty during the access request process and update the value with auto increment value. 

Example: Account - ABC1234 has already value of account customproperty45 as "ABC1234".

But another request will be submitted for the same user with account name of "ABC1234-1" (Handled with account name rule), during this process, we need to validate the existing account CP45 and do the auto increment to "ABCD1234-1" to match new account name.  

Your inputs will be greatly appreciated.

Regards,
SJ

3 REPLIES 3

jsatish
Regular Contributor
Regular Contributor

Thanks, i am able to identify the solution.

Dave
Community Manager
Community Manager

Care to share what the solution was for others who may have a similar problem? 

jsatish
Regular Contributor
Regular Contributor

select distinct (CASE
when a.customproperty45=u.username then concat(u.username,'-1')
when a.customproperty45=CONCAT(u.username,'-1') then concat(u.username,'-2')
when a.customproperty45=CONCAT(u.username,'-2') then concat(u.username,'-3')
when a.customproperty45=CONCAT(u.username,'-3') then concat(u.username,'-4')
when a.customproperty45=CONCAT(u.username,'-4') then concat(u.username,'-5')
when a.customproperty45=CONCAT(u.username,'-5') then concat(u.username,'-6')
when a.customproperty45=CONCAT(u.username,'-6') then concat(u.username,'-7')
when a.customproperty45=CONCAT(u.username,'-7') then concat(u.username,'-8')
when a.customproperty45=CONCAT(u.username,'-8') then concat(u.username,'-9')
else u.username END) AS ID FROM users u join user_accounts ua on u.userkey=ua.userkey join accounts a on ua.accountkey=a.accountkey join endpoints e on e.endpointkey=a.endpointkey WHERE lower(e.endpointname) = 'ABC' and lower(u.userkey) = ${requestee} and u.statuskey = 1 and upper(a.status) not like 'SUSPENDED FROM IMPORT%'