Assigning to Specific Users

Sometimes you don't want to just assign workflow to a role, but instead want to send it to a specific user, or set of users.

 To do this, you add a simple one-line script under "Assignment Script":

 

 You put this on the stage above the buttons you want assigned.

 This script needs to return a user record for the user you wish to assign the workflow to. It can also return a list of users. The input will be #input to access the workflow stage input form, or #rec to access the whole record.

Let's look at an example. Say you have a field that is a link dropdown to the Users list, letting the user select who they want to approve the next stage. This field, for example, is called Manager. Then your Assignment Script would read:

return load(GetPath(#input/Manager))

This loads the user that is linked-to in the Manager field of the input, and returns it. The workflow will now be assigned to whoever they selected.

Note, though, that if you select a role for the stage, the assigned user must also have the role that is set for this button, or they won't have permission to run the action at that workflow stage.


Next Topic:
v4.2.0.956 (beta)
Up Since 2/29/2024 12:02:23 AM