Use the Execute function action to run a named function within an active Python Script session, optionally passing arguments and capturing the return value in a variable.
Settings
-
Select any of the following tabs to create a Python session:
- Session name: Enter the same session name you used in the Open action.
- Variable: Enter a session variable of subtype Python script session.
- [CONFIRMED LABEL]: Enter the name of the function to execute.
- Input parameters (Optional): Provide the arguments required
for the function.
This field supports Boolean, dictionary, list, number, or string variables.Note: The interface allows you to select only one argument. Use a list variable to pass multiple arguments as a single input.
- (Optional) In the Assign the output to variable field, specify a variable to store the return value.
- Turn on the Throw an exception if the python script fails check box to ensure that the automation displays the same error message as the Python Script in case of any failures.
See the following examples to learn how to use the Python Script actions when building automations.