You’ll need two text fields, one for the form mapping and the other for the formula.
Create a formula with a case statement that creates a Random Integer in all cases.
The isDefault() method checks if element4 (the text field with form mapping) is Empty.
The Randint() method generates a random number between the first and second number provided as parameters.
The form mapping is set to map without parent value and sets the child (element4) to the string value entered in the field “Child form value” as soon as the workflow request is initiated.
Element 4 is just used to trigger the formula for the Random Integer. This can be hidden from the user with a Condition that Hides the Form item in all cases. Make sure to check the box to “Submit even if element is hidden”
When the workflow is initiated you will see the random number generated automatically without human interaction.