Generate a unique 6 digit number

Hi there, @cobi… to make sure each class code is unique, you can use a recursive backend workflow. Here is an example that takes a class (which, in the example, is a custom data type) as a parameter.

The first action in the workflow makes changes to a class, and the change it makes is to generate a class code for the class.

The second action in the workflow schedules the workflow again if a count of a search for class codes that are the same as the class code that was just generated is greater than 0.

On the front end, you would create a new class in a workflow, and the next step in that workflow would schedule the backend workflow and pass the newly-created class to it. At that point, the backend workflow will take care of generating a unique class code.

Hope this helps.

Best…
Mike

3 Likes