...
The script must be uploaded to the LogicHub (drag and drop script file to Automations > Scripts).
Operator Usage in Easy Mode
- Click + on the parent node.
- Enter the Call Script operator in the search field and select the operator from the Results to open the operator form.
- In the Input Table drop-down, enter or select the table containing the data to run this operator on.
- In the Script Name drop-down, select the name of the script.
- In the Args drop-down, select one or multiple column names to use as arguments for the script.
- In the Time between Calls field, enter a value in seconds, minutes, hours, days, or weeks.
- Click Run to view the result.
- Click Save to add the operator to the playbook.
- Click Cancel to discard the operator form.
Usage Details
LQL Command
Code Block |
---|
callScript(inputTable, scriptName, args, timeBetweenCalls) |
...
args
are the columns names (such as ["user", "accessCode"]). From the script they are accessed using sys.argv[1] and so on. To produce output to the table, you must print the result. See examples below for more information.
Example 1
Table = "users"
firstName | lastName | emailAddress |
---|---|---|
Emil | Bilgazyev | emil@logichub.com |
...
firstName | lastName | emailAddress | output | exitCode | error |
---|---|---|---|---|---|
Emil | Bilgazyev | emil@logichub.com | BILGAZYEV Emil works at LOGICHUB |
Example 2
If the script produces multiple rows for each row, you must print them as an array of JSON objects that will get populated into columns and rows.
...