Helper functions or one-off functions that don't have a category yet
Utility functions are a mix of helper functions or one-off functions that don't have a category yet. They contain functions that range from helping you debug and test your API endpoint, to functions that help you enforce.
- Return - Return a result and exit the function stack.
Preconditions are useful if you want to enforce that something is true and create an error message in the event it is not true.
Set conditions that must be true If not met, the request will stop. You can also specify an error message below.
Set a custom HTTP header.
Pauses execution of the Function stack and goes to sleep. (Think of it like waiting or pausing to execute).
In this example, the Sleep function is set to pause for 5 seconds.
Calculate the distance between two longitude/Latitude points
Stops execution of the Function Stack at a specified point and prints out the data. (This can be advantageous when testing and debugging complex logic in the Function Stack).
In this example, the specified value for Stop & Debug to print out is the variable "merchant."
In this example, Stop & Debug is inserted in the Function Stack where we wish to stop execution. Additionally, the specified data is printed out at the point where execution was stopped.
Return will return a result and exit the Function Stack. Return can be especially useful with conditional logic that requires you to return something as soon as you have a certain result.
In this example, the Return function is shown in the response due to the condition that was met, despite var: result being defined in the response.