Announcing the SAVIYNT KNOWLEDGE EXCHANGE unifying the Saviynt forums, documentation, training, and more in a single search tool across platforms. Click HERE to read the Announcement.

Json - Auto generated employeeId

Jillustre
New Contributor III
New Contributor III

In an CreateAccountJson, is there a way to make an auto generated employeeId based of the max existing one plus 1?

9 REPLIES 9

avinashchhetri
Saviynt Employee
Saviynt Employee

@Jillustre,

EmployeeID is user specific not account. Are you looking to create/generate a new employeeID for each account ? Isn't employeeID part of your user attribute ?

Regards,
Avinash Chhetri

rushikeshvartak
All-Star
All-Star

You can generate


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

Could you please elaborate how we can achieve this?

Apart from using SQL generator function is there any other way !

Regards,

Hitesh Sapkota

validate if that works in json or not here random number between 100 to 1000

(int)(java.lang.Math.random()*(1000-100+1)+100)


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

h_sapkota
Regular Contributor
Regular Contributor

Hi Rushikesh,

If we want to get some value incremented from max of value of users.

For Eg:

Users have employee Id in cp10 and max of all users cp10 is 101.

I want to pass max+1 as employeeid in createaccountjson i.e. 102.

How can we achieve this? First how do we find the max of cp10 from all the users data.

Regards,

Hitesh Sapkota

Create dynamic attribute and use that dynamic attribute in json


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

Sorry for ma late answer on this. How we can do that a dynamic attribute?

select max(employeeid)+1 as id from users


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

h_sapkota
Regular Contributor
Regular Contributor

Hi Jillustre,

Use select sql query in dynamic attribute to get the max value of employeeid for all the users and then add 1 value which will be your required max value + 1.

Regards,

Hitesh Sapkota