Skip to main content

Custom Functions


For advanced or highly customized data processing scenarios, you can use custom functions to implement flexible logic and transformations.

  • Supported language: JavaScript

  • Each function can return a single value only

  • Use the return statement to output the result

  • Custom functions run asynchronously in a separate thread and do not block the UI

  • If no result is returned within 1 second, the function will be automatically terminated

  • Supported only when configuring field default values
    (Not supported in workflow calculation nodes — use the code block node instead)

Usage Example

This example demonstrates how to:

  • Access field values within a function
  • Process data using custom logic
  • Return the computed result

1. Enable Custom Functions

In the default value settings of the Date of Birth field, select Function Calculation, then enable Custom Function.

2. Write Custom Function Code

Access field values

Define variables at the beginning of the function to receive field values.
After the equals sign (=), select the corresponding field from the left panel.

Return the result using return

  • Return a value directly:

  • Or assign the result to a variable and return the variable:

3. Save the Function

4. Test the Function

5. Retrieve URL Query Parameters

When using custom functions, you can access URL query parameters using:

SYSTEM_URL_PARAMS.paramName

Where paramName is the parameter key.

Example: Retrieve the corpid parameter from the URL.

Not supported

This method is available only in browsers and is not supported in mobile apps.

Example

Current URL: https://www.mingdao.com/public/form/93cdbb7e20c843478cf988d2d428d86b?corpid=aa163&secledId=123456

Configure custom functions for two text fields:

Custom Function CodeRetrieved Value
return SYSTEM_URL_PARAMS.corpidaa163
return SYSTEM_URL_PARAMS.secledId123456

You can modify the values of corpid and secledId in the URL and refresh the page to retrieve updated values.

If the URL of a view page contains parameters, they can also be accessed when creating a new record.

Was this document helpful?