This function can bulk update the status field in multiple work orders.
As of r338, Functions is in Production Early Access. To request access, contact your Customer Success manager.
Read more in the Community thread here.
Introduction
Functions allow your team to build shared or standardized logic once, and then reuse in multiple apps. In this example we are showcasing functions which can bulk update the status field in multiple work orders.
Function Flow
The function's flow is shown below:
Walkthrough
Functions are triggered by a trigger in an application. In the function, you can define inputs that need to be provided by the trigger that calls the function.
In this specific function, we require two inputs.
The first input is a variable list of Work Order IDs, and the second is a Status variable.
These two variables are provided to the function call by the trigger.
The function uses these inputs to execute.
First, the function is called by a trigger. After the function call, a looping action takes place. Here, the input is the previously mentioned Work Order IDs variable list.
Next, the function gets the first record from the Work Order table based on the ID from the looping action.
In the next action, the function will update the status field of the selected record with the value provided in the app under the status variable.
This will repeat until the Work Order IDs variable list is empty.
Modifying the function
In the function, you can modify almost everything to fit your process. This specific function uses the Work Order table, but if you would like to use a different table, you can do so by modifying the relevant actions to reference your table instead of the Work Order table. Additionally, if you want to update more fields or different fields, you can do so by changing or duplicating the Update Order Status action.
Further Reading
If you would like to get to know more functions, check out these other documents to extend your knowledge