Skip to main content

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.

  1. Create New

image.png

  1. 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.

image.png

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.

image.png

Edit and Delete Existing Functions

❗️❗️❗️Once a function is deleted, any dynamic values that used that function will no longer work properly.

image.png

Use Custom Functions

After creating a custom function, you can use it when inserting dynamic values. Using Dynamic Values

image.png

image.png

Best Practices

Let’s assume you want to add a function to check whether a number is odd or even.

  1. Create a new function named is_even with the following method:
return text % 2 == 0;

image.png

  1. Test if the function is correct by entering a number into the input box and clicking Test. Once confirmed, proceed to save.

image.png

  1. 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.

image.png