- 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
- Variables
- Arguments
- Imported Namespaces
- Recording
- UI Elements
- Control Flow
- Selectors
- Object Repository
- Data Scraping
- Image and Text Automation
- Automating Citrix Technologies
- RDP Automation
- SAP Automation
- VMware Horizon Automation
- Logging
- The ScaleCoordinates Migration Tool
- The ScreenScrapeJavaSupport Tool
- The WebDriver Protocol
- StudioPro
- Extensions
- Troubleshooting
Studio User Guide
UiPath Proprietary Variables
The GenericValue variable is a type of variable that can store any kind of data, including text, numbers, dates, and arrays, and is particular to UiPath Studio.
GenericValue variables are automatically converted to other types, in order to perform certain actions. However, it is important to use these types of variables carefully, as their conversion may not always be the correct one for your project.
UiPath Studio has an automatic conversion mechanism of GenericValue variables, which you can guide towards the desired outcome by carefully defining their expressions. Take into account that the first element in your expression is used as a guideline for what operation Studio performs. For example, when you try to add two GenericValue variables, if the first one in the expression is defined as a String, the result is the concatenation of the two. If it is defined as an Integer, the result is their sum.
Name/Syntax |
Description |
---|---|
CompareTo
|
[Click here for details.][1] [1]: https://msdn.microsoft.com/en-us/library/system.string.compareto(v=vs.110).aspx |
Contains
|
[Click here for details.][2] [2]: https://msdn.microsoft.com/en-us/library/dy85x1sa(v=vs.110).aspx Used to check whether a string variable contains a certain substring or not. For example, if you want to check if a sentence
contains a specific word, the expression should be
[SentenceVariable].Contains("term") , where [SentenceVariable] is the GenericValue variable containing the sentence and "term" is the word to be searched for.
Note: When using this method with a GenericValue variable of data type Int, Float or Boolean, the data is automatically converted
to String and handled accordingly.
|
Equals
|
[Click here for details.][3] [3]: https://msdn.microsoft.com/en-us/library/system.string.equals(v=vs.110).aspx |
GetHashCode
|
[Click here for details.][5] [5]: https://msdn.microsoft.com/en-us/library/system.string.format(v=vs.110).aspx |
GetType
|
[Click here for details.][6] [6]: https://msdn.microsoft.com/en-us/library/system.object.gettype(v=vs.110).aspx |
GetTypeCode
|
[Click here for details.][7] [7]: https://msdn.microsoft.com/en-us/library/system.string.gettypecode(v=vs.110).aspx |
IndexOf
|
[Click here for details.][8] [8]: https://msdn.microsoft.com/en-us/library/system.string.indexof(v=vs.110).aspx Used to return the index of a substring contained inside a string variable. For example, if you want to find the index of
the word "locate" inside the sentence "Find 'locate' in this sentence", the expression should be
[SentenceVariable].IndexOf("locate") , where [SentenceVariable] is the GenericValue variable containing the sentence and "locate" is the term to be searched for.
Note: When using this method with a GenericValue variable of data type Int, Float or Boolean, the data is automatically converted
to String and handled accordingly.
|
Length
|
[Click here for details.][9] [9]: https://msdn.microsoft.com/en-us/library/system.string.length(v=vs.110).aspx Used to return the number of characters in a string variable. For example, if you want to find out how many letters a word
has, the expression should be
[WordVariable].Length , where [WordVariable] is the GenericValue variable containing the word.
Note: When using this method with a GenericValue variable of data type Int, Float or Boolean, the data is automatically converted
to String and handled accordingly.
|
Replace
|
[Click here for details.][10] [10]: https://msdn.microsoft.com/en-us/library/system.string.replace(v=vs.110).aspx Used to replace data contained inside a string variable. For example, if you want to change a local file path
C:\ExampleFolder\Main.xaml into the corresponding server file path C:/ExampleFolder/Main.xaml , the expression should be [PathVariable].Replace("\","/") where [PathVariable] is the GenericValue variable containing the file path, "\" is the character to be replaced and "/" is the character used as replacement.
Note: When using this method with a GenericValue variable of data type Int, Float or Boolean, the data is automatically converted
to String and handled accordingly.
|
Split
|
[Click here for details.][11] [11]: https://msdn.microsoft.com/en-us/library/system.string.split(v=vs.110).aspx Used to return individual components from a string variable. For example, if you want to extract the year from a MM.DD.YYYY
date format, the expression should be
[DateVariable].Split(".".ToCharArray)(2) , where [DateVariable] is the GenericValue variable containing the date, "." is the character used as a separator, .ToCharArray is a method that creates an array with the elements delimited by the separator and (2) represents the index of the element to be returned, in our case, the year.
Note: When using this method with a GenericValue variable of data type Int, Float or Boolean, the data is automatically converted
to String and handled accordingly.
|
Substring
|
[Click here for details.][12] [12]: https://msdn.microsoft.com/en-us/library/system.string.substring(v=vs.110).aspx Used to return a substring contained in a string variable. For example, if you want to extract a word from the "There are
100 machines available" sentence, the expression should be
[SentenceVariable].Substring(10,3) , where [SentenceVariable] is the GenericValue variable containing the sentence, 10 is the index of the first character to be returned, and 3 is the
length of the substring starting from the first character. In this example, the resulted substring would be "100".
Note: When using this method with a GenericValue variable of data type Int, Float or Boolean, the data is automatically converted
to String and handled accordingly.
|
ToBoolean
|
[Click here for details.][13] [13]: https://msdn.microsoft.com/en-us/library/bb346937(v=vs.110).aspx |
ToByte
|
[Click here for details.][14] [14]: https://msdn.microsoft.com/en-us/library/bb355898(v=vs.110).aspx |
ToChar
|
[Click here for details.][15] [15]: https://msdn.microsoft.com/en-us/library/bb335877(v=vs.110).aspx |
ToDecimal
|
[Click here for details.][17] [17]: https://msdn.microsoft.com/en-us/library/bb359959(v=vs.110).aspx |
ToDouble
|
[Click here for details.][18] [18]: https://msdn.microsoft.com/en-us/library/bb154906(v=vs.110).aspx |
ToInt
|
Used to convert a specified value to a nullable integer. Note: When using this method with a GenericValue variable of data type Boolean, the "True" and "False" values are converted to
1 and 0, respectively.
|
ToInt16
|
[Click here for details.][20] [20]: https://msdn.microsoft.com/en-us/library/bb293091(v=vs.110).aspx Note: When using this method with a GenericValue variable of data type Boolean, the "True" and "False" values are converted to
1 and 0, respectively.
|
ToInt32
|
[Click here for details.][21] [21]: https://msdn.microsoft.com/en-us/library/bb300452(v=vs.110).aspx Note: When using this method with a GenericValue variable of data type Boolean, the "True" and "False" values are converted to
1 and 0, respectively.
|
ToInt64
|
[Click here for details.][22] [22]: https://msdn.microsoft.com/en-us/library/bb359566(v=vs.110).aspx Note: When using this method with a GenericValue variable of data type Boolean, the "True" and "False" values are converted to
1 and 0, respectively.
|
ToLower
|
[Click here for details.][23] [23]: https://msdn.microsoft.com/en-us/library/system.string.tolower(v=vs.110).aspx Note: When using this method with a GenericValue variable of data type Int, Float or Boolean, the data is automatically converted
to String and handled accordingly.
|
ToLowerInvariant
|
[Click here for details.][24] [24]: https://msdn.microsoft.com/en-us/library/system.string.tolowerinvariant(v=vs.110).aspx Note: When using this method with a GenericValue variable of data type Int, Float or Boolean, the data is automatically converted
to String and handled accordingly.
|
ToSByte
|
[Click here for details.][25] [25]: https://msdn.microsoft.com/en-us/library/bb342232(v=vs.110).aspx |
ToSingle
|
[Click here for details.][26] [26]: https://msdn.microsoft.com/en-us/library/bb360375(v=vs.110).aspx |
ToString
|
[Click here for details.][27] [27]: https://msdn.microsoft.com/en-us/library/system.string.tostring(v=vs.110).aspx |
ToType
|
[Click here for details.][29] [29]: https://msdn.microsoft.com/en-us/library/bb358540(v=vs.110).aspx |
ToUInt16
|
[Click here for details.][30] [30]: https://msdn.microsoft.com/en-us/library/bb337265(v=vs.110).aspx Note: When using this method with a GenericValue variable of data type Boolean, the "True" and "False" values are converted to
1 and 0, respectively.
|
ToUInt32
|
[Click here for details.][31] [31]: https://msdn.microsoft.com/en-us/library/bb357762(v=vs.110).aspx Note: When using this method with a GenericValue variable of data type Boolean, the "True" and "False" values are converted to
1 and 0, respectively.
|
ToUInt64
|
[Click here for details.][32] [32]: https://msdn.microsoft.com/en-us/library/bb155099(v=vs.110).aspx Note: When using this method with a GenericValue variable of data type Boolean, the "True" and "False" values are converted to
1 and 0, respectively.
|
ToUpper
|
[Click here for details.][33] [33]: https://msdn.microsoft.com/en-us/library/system.string.toupper(v=vs.110).aspx Note: When using this method with a GenericValue variable of data type Int, Float or Boolean, the data is automatically converted
to String and handled accordingly.
|
ToUpperInvariant
|
[Click here for details.][34] [34]: https://msdn.microsoft.com/en-us/library/system.string.toupperinvariant(v=vs.110).aspx Note: When using this method with a GenericValue variable of data type Int, Float or Boolean, the data is automatically converted
to String and handled accordingly.
|
Trim
|
[Click here for details.][35] [35]: https://msdn.microsoft.com/en-us/library/system.string.trim(v=vs.110).aspx Note: When using this method with a GenericValue variable of data type Int, Float or Boolean, the data is automatically converted
to String and handled accordingly.
|
TrimEnd
|
[Click here for details.][36] [36]: https://msdn.microsoft.com/en-us/library/system.string.trimend(v=vs.110).aspx Note: When using this method with a GenericValue variable of data type Int, Float or Boolean, the data is automatically converted
to String and handled accordingly.
|
TrimStart
|
[Click here for details.][37] [37]: https://msdn.microsoft.com/en-us/library/system.string.trimstart(v=vs.110).aspx Note: When using this method with a GenericValue variable of data type Int, Float or Boolean, the data is automatically converted
to String and handled accordingly.
|
When using Ctrl + K, Ctrl + M, or Ctrl + Shift + M directly in the Format Value activity body, the created variable or argument is of type GenericValue. For other activities, the created type is the same as the required type of the activity.
To demonstrate how a GenericValue variable works, let us create an automation that performs different operations whose results depend on the way we define their expressions. We create two GenericValue variables of different data types and display the results in the Output panel.
- Create a new blank project.
- Create three GenericValue variables:
Int
,Str
, andResult
. -
In the Default column for the
Int
variable, type 12, and for theStr
variable, type "34". The first variable is interpreted as an integer, while the second one is interpreted as a string. - Add an Assign activity to the Designer panel and connect it to the Start node.
- In the Properties panel, in the To field, enter the
Result
variable. - In the Value field, type
Int
+Str
. - Add a Write Line activity and connect it to the Assign one.
-
In the Properties panel, in the Text field, enter the
Result
variable.The project should look as in the following screenshot.
-
Press F5 to execute your automation. Note that, in the Output panel, the sum of the two numbers is displayed.
-
Go back to the previously added Assign activity and change the Value field to
Str
+Int
, to reverse the order of the variables. The project should look as in the following screenshot. -
Press F5 to execute your automation. Note that, in the Output panel, the concatenation of the two numbers is displayed.
This means that UiPath Studio takes the first element defined in your expression as a guideline for what operation to perform. If the first element in your expression is an integer or a GenericValue variable filled in as integer, UiPath Studio will perform the sum of the elements.
If the first element in your expression is a string or a GenericValue variable filled in as string, UiPath Studio will perform the concatenation of the elements.
We recommend that you read the About Queues and Transactions page, for an overview on queues and transactions, before further proceeding to the QueueItem variable.
Before getting into an in-depth detailing of the subject, make sure you understand the distinction between queue items (items stored in a queue in Orchestrator) and QueueItem variables (variables used in Studio to process queue items). We refer to them exactly like that: “QueueItem variables” and “queue items”.
Broadly, as the name says, the QueueItem variable stores an item which has been extracted from a container of items, a queue. This extraction is generally made with the purpose of further using the queue items in various scenarios. Let’s say you represent a banking institution and you have a deposits’ report of 50 clients. You want to process the data of each client who had previously deposited an On-Us Check smaller than $5000, using a third-party financial application. In this regard, you can make a workflow in which the QueueItem variable stores, by turn, the information of each client. Each entry read by the QueueItem variable is stored in a queue item and added to the designated queue in Orchestrator. The result of this whole process is a queue which contains the clients' information, each in the corresponding queue item.
To further process the data which meets the condition, you must create another workflow which extracts from the previously created queue, the items with a corresponding On-Us Check value smaller than $5000. A step-by-step procedure on how to create such a project is provided at the end of this topic.
Name/Syntax |
Description |
---|---|
Equals
| |
GetHashCode
| |
GetType
| |
ToString
|
Name/Syntax |
Description |
---|---|
AssignedTo
| |
DueDate
|
The latest date and time at which the item should be processed. If empty, the item can be processed at any given time. |
DeferDate
|
The earliest date and time at which the item is available for processing. If empty, the item can be processed as soon as possible. |
Id
| |
ItemKey
|
The unique identifier of the item. For example,
1bf829e1-cd6b-4275-a364-19db3cfe09c7 .
|
Priority
|
The priority of the queue item as defined in Studio in the Priority field on the Properties panel. |
ProcessingException
|
The processing exception of a failed item. |
Progress
|
Custom progress information about a queue item whose status is InProgress. |
QueueDefinitionId
|
The unique identifier of the queue under which a queue item/transaction has been created. |
QueueName
|
The name of the queue containing the processed items. |
Reference
|
A user-specified value for easier queue item identification. |
RetryNo
|
The number of times the item has been retried. |
ReviewStatus
|
The revision status of the queue item as retrieved from Orchestrator. |
RowVersion
|
An internal field used for version stamping. It gets updated whenever a property of the current transaction is changed. |
SpecificContent
|
A collection of key value pairs containing custom data associated with the current transaction, as configured in the Add Queue Item activity. |
StartTransactionTime
|
The time and date the transaction processing began. |
Status
|
The status of the queue item as retrieved from Orchestrator. |
Due to the nature of this example, we have split this section in two parts, each representing one of the two main workflows to be used when working with queues and queue items:
Uploading Items Into a Queue
.xlsx
file. Let’s say you represent a banking institution and you have a deposits’ report of 50 clients. You want to process the
data of each client that previously deposited an On-Us Check smaller than $5000, using a third-party financial application.
The report contains the name of the client, the On-Us Check value, and two other additional values, let’s say Cash In and
Not On-Us Check. We create a workflow in which the QueueItem variable stores, by turn, the information of each client. Each
entry read by the QueueItem variable is then stored in a queue item and added to the designated queue in Orchestrator. The
result of this whole process is a queue which contains each clients’ specific information. Before proceeding to the actual
workflow, you might want to take a look at the clients’ report here. We are going to work with the "July Reports" sheet.
Without further ado:
- Create a new sequence.
- Add an Excel Application Scope activity inside the sequence, and define the location of the workbook in the Properties pane of the activity.
- Inside the Do section, add a Read Range activity to read the desired range of values from the report and store them in a DataTable variable. In our case, type
"A1-D51"
or simply leave the default value, “”, which means the entire spreadsheet is read. - In the Sheet Name field, type the name of the sheet, namely
“July Report”
. -
In the Data Table field, press Ctrl + K to create a new DataTable variable which stores the previously read data range. Name it
DataTable1
or similar. The Variables pane should also display the newly created variable as follows: -
Next, add a For Each Row activity to the Designer panel and fill in the blank fields with “row” and the name of the DataTable variable,
DataTable1
, respectively. This activity performs the action defined in the Body section for each row in the data table. The Do section should look similar to the following screenshot so far: - In the Body section of the For Each Row activity, add an Add Queue Item activity. This adds an item to a queue (defined below at steps 8 and 12), for each row in the spreadsheet.
- In the Properties pane, in the QueueName field, type the name of the queue you want your items to be stored in, let's say
ReportQueue
. -
In the Input section, click the button corresponding to the ItemInformation field to open the ItemInformation window. Create 4 arguments, each corresponding to a column from the report. Define them as follows:
Name
, keeping the default values for Direction and Type, and with Value set torow(0).ToString
. This retrieves the value from the column with the counter 0 for each row in the workbook, in our case the name of the client.CashIn
, keeping the default values for Direction and Type, and with Value set torow(1).ToString
. This retrieves the value from the column with the counter 1 for each row in the workbook, in our case the Cash In value.OnUsCheck
, keeping the default values for Direction and Type, and with Value set torow(2).ToString
. This retrieves the value from the column with the counter 2 for each row in the workbook, in our case the On-Us Check value.NotOnUsCheck
, keeping the default values for Direction and Type, and with Value set torow(3).ToString
. This retrieves the value from the column with the counter 3 for each row in the workbook, in our case the Not On-Us Check value.
-
The ItemInformation window should look similar to the following screenshot:
- Connect Studio’s Robot to Orchestrator. For details on how to do it, click here.
- Navigate to https://platform.uipath.com, log in using your credentials, and then create a queue, ReportQueue, to store the items. Make sure that, whatever name you used above (step 8), you use the same here.
- Go back to Studio. At this point your workflow should be error-free and functional, so the next step is to make it available to Orchestrator. In this regard click Design > Publish.
-
To run the process, click Design > Run.
Note: Take into account that, after being processed, queue items become transactions, and are further handled as such. - Navigate to https://platform.uipath.com again and display the transactions.
Processing the Transactions From a Queue
To demonstrate how to further process transactions from a queue, we are going to create a second workflow which retrieves from the appropriate queue, the transactions with an On-Us Check value smaller than $5000. For each transaction that meets the condition, the values are collected and introduced into a third-party dummy application. The other ones are labeled as business exceptions.
- Go to Design > New > Flowchart to create a new file in the project initiated above.
- Add an Open Application activity to open the third-party dummy application. Connect it to the Start node.
- Fill in the required details (Display Name, FileName, Selector) on the Properties panel, and configure the activity to log in with the corresponding credentials. Use
admin
for the Username field, andpassword
for the Password field. - In the FileName field, fill in the path of the application.
- In the Selector field, using Selector Editor, define a selector for UIDemo.
- Add a Should Stop activity to the Designer panel and connect it to the Open Application activity.
-
Add a Flow Decision activity to the Designer panel and connect it to the Should Stop activity. These last two activities check if you stopped the job while it was still running. This gives you the possibility to further configure the workflow to perform various safety routines after the stop is triggered. See below an example of such a routine:
- Add a Log Message activity and connect it to the True branch of the previously added flow decision.
- In the Properties panel, in the Message field, type “Stop process required” or something similar to be displayed if the stop is triggered.
- Add a Close Application activity and connect it to the Log Message activity previously added.
- In the Properties panel, in the DisplayName field, after Close application, type
UIDemo.exe UIDemo
.
- Add a Get Transaction Item activity to the False branch of the flow decision added previously (step 7). This activity retrieves the transaction items from the queue and stores them, by turn, with each iteration of the loop, in a QueueItem variable.
- In the Properties pane, in the QueueName field, type the name of the queue which stores your items. In our case, as defined in the Uploading Items into a Queue section, the name is "ReportQueue".
- In the TransactionItem field, press Ctrl+K to create the QueueItem variable which stores each transaction item. Name it "TransItem" or similar.
- Add a Flow Decision activity to the Designer panel and connect it to the Get Transaction Item activity.
- In the Properties pane, in the Condition field, type
TransItem isNot Nothing
. This activity checks the value of each item to determine if the end of the queue has been reached. - Connect the False branch of the flow decision to the Log Message activity created in step 7. This ensures the job stops when the end of the queue is reached.
- Add another Flow Decision activity to the Designer panel and connect it to the True branch of the flow decision created in step 11.
-
In the Properties pane, in the Condition field, type
cint(TransItem.SpecificContent("OnUSCheck").ToString) < 5000
, where:cint
converts a variable of type string to one of type integer.TransItem
is the QueueItem variable (step 18) used to store the items.SpecificContent("OnUSCheck")
retrieves the content of the On US Check argument in each item..ToString
converts the content of the QueueItem variable into a variable of type string.-
< 5000
is the condition to be checked against.The above expression converts the OnUSCheck value in each QueueItem variable into a string variable, which is then further converted into an integer. The value thus obtained is checked for compliance with the condition.
- Add a Set Transaction Status activity to the Designer panel, and connect it to the False branch of the previous flow decision (step 13).
- In the Properties pane, make sure the Status field is set to Failed, and ErrorType to Business. This way, if the value of On US Check is bigger or equal to 5000, the transaction is marked as failed with a business exception.
- In the TransactionItem field add the
TransItem
variable. - In the Reason field, type "OnUSCheck amount is bigger than 5000" or similar, to display for a failed transaction.
- Connect the Set Transaction Status activity to the Should Stop activity (step 6), to create a loop and process the next transaction in the queue.
- Add a Sequence activity to the Designer panel, and connect it to the True branch of the previous flow decision (step 13). Inside the sequence, add a Try Catch activity and configure it such that any potential errors are correctly labeled as application errors when processing the items.
- Open the UIDemo application, and log in with the username
admin
and the passwordpassword
. -
Perform the following series of activities for each of the Cash In, On Us Check and Not On Us Check fields in the UIDemo application:
- Into the previous Try Catch activity, add a Type Into activity.
- Click Indicate on screen and select from the UIDemo interface, the blank field corresponding to Cash In.
- In the Properties pane, in the Text field, type
transItem.SpecificContent("CashIn").ToString
. Each term in the expression is explained above (step 15). This expression converts the value in each QueueItem variable into a string variable. - Make sure that the Simulate Type option is selected.
-
On the Design tab, in the Wizards section, click Screen Scraping and point at the transaction number in the UIDemo application.
- From the Screen Scraper Wizard, choose a scraping method and click Finish. This inserts a Screen Scraping activity in your workflow. Make sure to position it after the previous Type Into activities, and set the Text field to a new variable, say
TransactionValue
. This retrieves the transaction number for each queue item that meets the initial condition. - Add a Set Transaction Status activity after the Screen Scraping activity.
- In the Properties pane, make sure the Status field is set to Successful, and the ErrorType is set to Application. This way, if the set of values is successfully introduced in the application, the status of the transaction is set to Successful, or else labeled as an application exception.
- In the Output window, define a new argument and add the previously created variable,
TransactionValue
(step 25) as value. - In the TransactionItem field, add the
TransItem
variable. - Add a Click activity to the Sequence activity after the Type Into activities.
- Click Indicate on screen and select the Accept button from the UIDemo interface. Make sure the Simulate Type option is selected.
-
The Try Catch activity should look similar to the following screenshot:
- Return to the flowchart and connect the previous Sequence activity (step 21) to the Should Stop activity (step 6) to create a loop and process the next transaction in the queue.
-
The flowchart should look similar to the following screenshot:
- To run the process, click Design > Run.
- After the execution has ended, you may navigate to https://platform.uipath.com and display the processed transactions with the corresponding processing details:
-
Successful Transaction
-
Failed Transaction