
ih5uc (ih5uc) asked a question.
I need to be able to generate a custom ID attribute (Eg:A12345) where the number is an autogenerated incremental number after a user is created in Okta. Can this be achieved using Okta workflows?
Do you have global variables in Okta where the last used ID can be stored?
Thank you

Hi @ih5uc (ih5uc),
Thank you for posting on the Okta community page!
I have done some research on my end and I assume that you could achieve your use case by using the Unique ID text card in which it will generate a random unique ID value. Also, you could use the Random card that will return a random text since with this card you can also set the length of the value.
I have provided bellow a couple of KB articles about the cards mentioned above:
For the second question, I was only able to find that you can create a table in Workflows where you can store the used IDs based on the flows that you are creating:
I hope the above information is helpful!
Hello @ih5uc (ih5uc)
The incrementing can definitely be handled by a flow. I've attached a sample flow I created that can achieve this. It takes a string as an input. Then determines if the last character is an integer, if not it will add 1. If it is an integer it will increase by one (even in situations where it is 001 it will go to 002)
The next part of your ask is essentially no, there isn't going to be a built-in global variable. You would need to create some logic to track that. This could be handled a bunch of different ways. As Flaviu mentioned a table is one option. The other option could be a Custom Profile Attribute that stores the value and a check is done to determine the "latest" value and then that latest value is incremented. This portion of your ask is the most concerning as it potentially could be the hardest part to scale.
incrementusernamebyonefinal