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

Set systemusername via createUserRequest API

maurabagley
New Contributor
New Contributor

There are cases where we want to set a systemUserName via the createUserRequest API instead of having the System Username Generation Rule generate it.  It doesn't work.  In looking at the logs, I see 
Evaluating Rule :: ADV:CASE WHEN systemUserName IS NULL THEN lower(concat(substring(users.firstname,1,3)  , substring(users.startdate,6,2)  , substring(users.startdate,3,2)  , substring('1',1,1))) ELSE systemUserName END
spclChars-
rule-ADV:CASE WHEN systemUserName IS NULL THEN lower(concat(substring(users.firstname,1,3)  , substring(users.startdate,6,2)  , substring(users.startdate,3,2)  , substring('1',1,1))) ELSE systemUserName END
ruleFilters-[ruletype:EMAIL]
specialChars-@._-
Advance Config Query found.
Advance Config Rule : CASE WHEN systemUserName IS NULL THEN lower(concat(substring(users.firstname,1,3)  , substring(users.startdate,6,2)  , substring(users.startdate,3,2)  , substring('1',1,1))) ELSE systemUserName END
Advance Config Query : select (CASE WHEN systemUserName IS NULL THEN lower(concat(substring(users.firstname,1,3)  , substring(users.startdate,6,2)  , substring(users.startdate,3,2)  , substring('1',1,1))) ELSE systemUserName END ) as property from users users where users.USERKEY=7194
New PropertyName :xyzabc123
SystemUserName xyzabc123 exists so ignoring rule (ADV:CASE WHEN systemUserName IS NULL THEN lower(concat(substring(users.firstname,1,3)  , substring(users.startdate,6,2)  , substring(users.startdate,3,2)  , substring('1',1,1))) ELSE systemUserName END )

It continues through each rule. At the end, it has:

All rules exausted. Unable to generate systemUserName
copysystemusernametousernameConfig = true
copysystemusernametousername =true

xyzabc123 is the systermUserName value sent in the API.  It doesn’t not already exist in Saviynt.  No systemUserName is set.

How can we set it via the createUserRequest API?

3 REPLIES 3

sudeshjaiswal
Saviynt Employee
Saviynt Employee

@maurabagley ,

Can you please confirm if the existing user is present in the system?
How many users are present with the same condition which is mentioned in the rule, Because the rules are getting exhausted?

Thanks

If you find the above response useful, Kindly Mark it as "Accept As Solution".

maurabagley
New Contributor
New Contributor

This is a new user that gets created by the API but the systemusername is blank.  It shouldn't even run the rules because I am passing the systemusername in the API.  However, if I didn't pass in the systemusername, the first rule would generate a systemusername.  

sudeshjaiswal
Saviynt Employee
Saviynt Employee

Hello @maurabagley,

I noticed that the /createuser API documentation does not include Systemusername in the list of attributes mentioned.
For reference: https://documenter.getpostman.com/view/20697337/2s935smLj6#ec459425-25f3-48b3-a2ab-bd14c062767d 

However, you can try the following steps to set up the systemusername:

  1. Disable the systemusername generation rule and attempt passing the systemusername in the API request to see if it works.
  2. If the API does not allow setting the systemusername directly, you can consider using the sav4sav connector to invoke the update user task from the user update rule and set the systemusername using the UPDATEUSERJSON in the sav4sav connector.

    Thanks,
If you find the above response useful, Kindly Mark it as "Accept As Solution".