For Each Function
For each function is used in performing multiple actions from a single workflow.
Let’s say, IT Admin wants to add all employees that are in HRMS tool to the ITSM tool, for each function is very helpful to capture individual employee details using Get all employees actiona nd then add each employee details in ITSM tool.
IT admins can add all employees from Bamboo HR to Freshservice App by following the steps below.
1. Click on Create New and then Name the workflow and click on Create.
2. Click on Add input to enter the input fields required for the workflow.
3. Add Requestor email as the Input field and click on Save
4. In Step – 2, click on the (+) symbol and click on Add Action
5. Select the Application as BambooHR
6. Select the Action as ‘Get all Employees’
Connect to your BambooHR account and then click on Test connection and click on Save
7. Click on Requester Email input field and then click on Requester Email from the Variable picker box.
8. Click on Save
9. Click on (+) symbol below Get All Employees and select Add For-Each
10. Enter the name for this Function in For-Each name field and then choose Output from BambooHR (Employee Details) in Select a Collection Box and click on Save.
11. Click on the (+) symbol again and choose Add Action
12. Select the Application as Freshservice
13. Choose the Action as Add Requester and connect your Freshservice account.
14. Update the Input fields by clicking the Right arrow (>) in the Variable Picker pop up box
Note: The input field can only be the output data selected from the For-Each function. (Bamboo HR app)
15. Upon clicking on the > arrow under Variable Picker box, all the input fields are popped up.
Map appropriate fields in the Input fields using the Variable Picker box
16. Once all the Input fields are mapped, click on Enable Error Handling to handle Success & Failure scenarios for the automation.
17. Once For-Each Function is completed, Admins can continue with the workflow by adding more actions to the workflow if they like(Such as creating a ticket or send a message or sending an email)
18. Once the workflow is setup, Admins can test the workflow by clicking on the Run button on the top right corner of the screen and entering the input fields to execute the workflow.