Set variable
This is the action used to create or change the value of a variable (data container) in the script. Additionally, this action allows you to create input fields directly in the main interface, enabling users to fill in information before starting to run the tool.
Allow user input from the interface: You check this option to create empty fields on the main screen, allowing users to directly enter values into the script before clicking run.
Input required: When this option is selected, the system will require users to fill in all data or select a file before allowing them to click the run button. If left empty, the tool will immediately report an error to avoid running mistakenly due to forgotten information.
🎥 See more instructional video: Here.

The system supports 4 types of input data (Input Type) on the interface, including:
1. Text Input Type
Used when you want users to manually enter a string value, text, or number from the keyboard.
Real example: You name the variable
$textContent. When the user enters the content"hello world"into the input field on the interface, the value of the variable$textContentat this time will be"hello world"($textContent = "hello world").


2. File Input Type
Used when the script needs to process a specific file on the user's computer (such as an image file, data file, configuration file...). A folder icon button will appear on the UI for users to click and browse for the file.
Real example: The user selects a file named
bruh.pnglocated on drive D. The value of the variable$filePathreceived will be the absolute path of that file:"D:\materials\bruh.png"($filePath = "D:\materials\bruh.png"). You can immediately use this$filePathvariable to pass into the File upload action in subsequent steps.


3. Checkbox Input Type
Checkbox is a UI component that allows users to toggle a binary option (yes/no, on/off, agree/disagree).
Characteristics: When checked, the variable will receive the value
True. When unchecked, the variable will receive the valueFalse.Real example: You create an item labeled "Check to place an order" associated with the variable
$checkBox. If the user checks this box, the variable$checkBoxwill have the valueTrue($checkBox = True). You can use an If block to check: if$checkBox = True, then proceed with the payment steps.

4. Combo Box Input Type
Combo Box (similar to Dropdown) is a UI component that displays a list of available options, allowing users to select a single value at a time. This feature helps minimize the chances of misspelling or incorrect data formatting.
Characteristics: Helps maintain consistent data when selecting fixed information such as Country, Industry, Product Type, Operational Status...
Real example: You configure a list of several countries associated with the variable
$country. When the user opens the script and selects"United States"from the dropdown list, the variable$countryin Automate will immediately receive the value"United States"($country = "United States").


Last updated
Was this helpful?