Function
This user guide aims to help users understand how to create and customize processing functions in the tool to flexibly handle parameter values. Users can write custom functions according to their specific needs and manage and apply them within the tool.
Function Overview
Create a New Processing Function
New functions can be created in the project settings — Functions.
- Create New
- Fill in the Function Information caution
Function names only support a combination of numbers, letters, and underscores.
Make sure to test the function before saving it to avoid runtime errors.
Function names must be unique and cannot be modified after creation.
View Function Execution Results
You can test the function execution results in the validation area to ensure the function is created successfully and works properly.
If there are no issues, you can proceed to save it.
Edit and Delete Existing Functions
❗️❗️❗️Once a function is deleted, any dynamic values that used that function will no longer work properly.
Use Custom Functions
After creating a custom function, you can use it when inserting dynamic values. Using Dynamic Values
Best Practices
Let’s assume you want to add a function to check whether a number is odd or even.
- Create a new function named
is_even
with the following method:
return text % 2 == 0;
- Test if the function is correct by entering a number into the input box and clicking Test. Once confirmed, proceed to save.
- Apply in dynamic values by choosing any type, for example, select a variable (to check the oddness or evenness of the variable value) and add the custom function; click insert or replace. When sending in actual scenarios, the real data will be the result after function processing.