Menu

Common Scenario 1: Custom Parameter Variable – Batch Text

When creating a workflow, the data used often needs to be modified. You can import empty variables first, and fill in the real data when the task is executed. The following demonstrates this process.

Add Variables

Add a global variable and select Batch Text as the type. Since only the variable name is used here, you can uncheck “Required.” Real parameters will be filled in during task execution.

During debugging, you can set a default value like:

Copy
user1|pass1
user2|pass2
user3|pass3

Loop Through Data

You can loop through the data directly and use logs to check each line. The looped data can be extracted as text. Using regular expressions, you can capture specific parts of the data. In the example, both the data variable and the new variable line from text extraction are output in logs.

After running the debug, the logs show that data contains the entire array, while text extraction outputs individual elements.

Extract Data

From the logs, each iteration captures the current line of data. To use the data, you may need to split it by |. Adjust text extraction to flexibly capture the desired part. By default, it takes the first captured group, so wrap the target part in ().

Extract the first segment:

Copy
(.+)\|.+

Extract the second segment:

Copy
.+\|(.+)

For more fields, e.g., third segment:

Copy
.+\|.+\|(.+)

Edit the workflow to extract the required data.

Logs will show each segment successfully captured and saved as a variable.

Scheduled Task

When publishing a scheduled task, you can fill in the actual data to be used.

Previous
Third-party tools
Next
Common Scenario 2: Fetching Dynamic Parameters via Network Request
Last modified: 2026-01-05Powered by