Studio has a range of different tasks that you can use to build different processes. Being a no-code application you would not commonly be using any kind of code or any variables and functions. However, there would be times when you can achieve just the expected output using your custom variables; you can define conditional tasks without writing a single line of code.
Let us have a quick look at this video to understand how to add a variable block.
Studio provides the Variable block which can be used to create the variables that can be used anywhere in the other tasks of the workflow. Now let us consider an example to understand the variable block. Let us consider a form for adding a request for leave. A notification or email should be sent to the initiator’s manager informing of the request. In this scenario, you create a variable block that would be used to fetch the name of the manager based on the username of the initiator.
Add the Variable block and click Continue. Now assign an appropriate task name and description(optional) and click Next.
Now add the variable Name. This variable will be used in your workflow tasks as Taskname.defined_variable.
So for the example here let us add the variable name as Managers. The value for the variable will be derived as a LOOKUP from the Users sheet which has the list of Users, their department, their managers details like email store.
The LOOKUP formula used here is :
LOOKUP([users.manager] , users.UserName = INPUTBYNAME)
- manager is the value from the manager column that holds the email address
- UserName is User name column from where the value will be matched with the INPUTBYNAME
- INPUTBYNAME is the Initiator’s or Current user’s Name
You can add as many variables as you need. Once you have added the necessary variables, click Done.
Now that the variable is added, you will be sending an email to the Manager. This variable will be used to get that email id to whom the email would be sent.
So let us add the Email Task. Add the Task name and description(optional) and click Next.
Now define the details to assign the task, in this case to the user’s manager. We have defined the variable for the purpose of fetching the manager’s email. You can use the option, “Use Formula to resolve User”, and add the variable as Variable_Task.Managers.
Add the Sender Details and the Receiver email configuration details. Click Done and your email task is now ready.
Now your workflow is ready for sending Email to the manager for leave application.
Make sure that you link the Workflow to the Submit button.
Now whenever the leave request is made by the user, an email would be sent to the manager with the necessary details.
Form submitted for leave application by the User
Email received by the manager
The variable block that was created can be used by other tasks as well. You can use the variables as required.