- Release Notes
- Getting Started
- Setup and Configuration
- Automation Projects
- Dependencies
- Types of Workflows
- File Comparison
- Automation Best Practices
- Source Control Integration
- Debugging
- The Diagnostic Tool
- Workflow Analyzer
- About Workflow Analyzer
- ST-NMG-001 - Variables Naming Convention
- ST-NMG-002 - Arguments Naming Convention
- ST-NMG-004 - Display Name Duplication
- ST-NMG-005 - Variable Overrides Variable
- ST-NMG-006 - Variable Overrides Argument
- ST-NMG-008 - Variable Length Exceeded
- ST-NMG-009 - Prefix Datatable Variables
- ST-NMG-011 - Prefix Datatable Arguments
- ST-NMG-012 - Argument Default Values
- ST-NMG-016 - Argument Length Exceeded
- ST-DBP-002 - High Arguments Count
- ST-DBP-003 - Empty Catch Block
- ST-DBP-007 - Multiple Flowchart Layers
- ST-DBP-020 - Undefined Output Properties
- ST-DBP-023 - Empty Workflow
- ST-DBP-024 - Persistence Activity Check
- ST-DBP-025 - Variables Serialization Prerequisite
- ST-DBP-026 - Delay Activity Usage
- ST-DBP-027 - Persistence Best Practice
- ST-DBP-028 - Arguments Serialization Prerequisite
- ST-USG-005 - Hardcoded Activity Arguments
- ST-USG-009 - Unused Variables
- ST-USG-010 - Unused Dependencies
- ST-USG-014 - Package Restrictions
- ST-USG-020 - Minimum Log Messages
- ST-USG-024 - Unused Saved for Later
- ST-USG-025 - Saved Value Misuse
- ST-USG-026 - Activity Restrictions
- ST-USG-027 - Required Packages
- ST-USG-028 - Restrict Invoke File Templates
- Variables
- Arguments
- Imported Namespaces
- Control Flow
- Object Repository
- Logging
- The ScreenScrapeJavaSupport Tool
- Studio testing
- Extensions
- Troubleshooting
- About troubleshooting
- Microsoft App-V support and limitations
- Internet Explorer X64 troubleshooting
- Microsoft Office issues
- Identifying UI elements in PDF with Accessibility options
- Repairing Active Accessibility support
- JxBrowser applications troubleshooting
- User Events Monitoring
- Citrix Troubleshooting
- Automating Applications Running Under a Different Windows User
To exemplify how you can work with array variables, we are going to create an automation that asks the user for his first and last name and age, stores the information in an array and then writes it in a .txt file.
-
Create a new sequence.
-
Create three string variables,
FirstName,LastNameandAge, in which to store the information gathered from the user. -
Create an array of strings variable called
NameAge. -
Add an Input Dialog activity to the Designer panel.
-
In the Properties panel, fill in the Label and Title fields to ask for the user’s first name.
-
In the Result field, type the
FirstNamevariable. This variable stores the first name of the user. -
Add another Input Dialog activity under the previous one.
-
In the Properties panel, fill in the Label and Title fields to ask for the user’s last name.
-
In the Result field, type the
LastNamevariable. This variable is going to store the last name of the user. -
Add another Input Dialog activity under the previous one.
-
In the Properties panel, fill in the Label and Title fields to ask for the user’s age.
-
In the Result field, type the
Agevariable. This variable is going to store the age of the user.Note:We use a string variable and not an integer to store the age, so that we do not have to convert it later on, when we add it to the string array variable.
-
Add an Assign activity under the last Input Dialog.
-
In the Properties panel, in the To field, type the
NameAgevariable. -
In the Value field, type {
FirstName,LastName,Age}. This Assign activity enables you to store all the values from the initial string variables in theNameAgeone. -
Add a Write Text File activity under the Assign one.
-
In the Properties panel, in the FileName field, type the path of the file you want to write to between quotation marks, such as
"%HOMEPATH%\Desktop\array_variable.txt".Note:If the file does not exist at the provided path, it is created.
-
In the Text field, type
NameAge(0)+ " " +NameAge(1)+ " " +NameAge(2)+ " ".Note:By adding the index number of the array items you can access their values and write them, in this example, to a text file.
The final project should look as in the following screenshot.
-
Press Ctrl + F5 to run the project.
-
Navigate to the file provided at step 17 and double-click it. A Notepad window is displayed with the information you added at step 20.