0% found this document useful (0 votes)
1 views48 pages

Module 3

The document provides a comprehensive overview of managing variables in Robotic Process Automation (RPA), detailing various types such as user, system, and credential variables, along with their characteristics and best practices. It covers specific variable types including text, boolean, number, array, date-time, and data-table variables, emphasizing their use cases and operational techniques. Additionally, the document outlines the importance of naming conventions, data validation, and documentation for effective variable management in automation workflows.

Uploaded by

Kanak Rai
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
1 views48 pages

Module 3

The document provides a comprehensive overview of managing variables in Robotic Process Automation (RPA), detailing various types such as user, system, and credential variables, along with their characteristics and best practices. It covers specific variable types including text, boolean, number, array, date-time, and data-table variables, emphasizing their use cases and operational techniques. Additionally, the document outlines the importance of naming conventions, data validation, and documentation for effective variable management in automation workflows.

Uploaded by

Kanak Rai
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Variable , Data table and

Recording for RPA


Prepared by : Mrs. Swati Chiplunkar
Contents
• Managing-variables
• Naming-best-practices
• The-variables-panel
• Generic-value-variables
• Text-variables
• True-or-false-variables
• Number-variables,
• Array-variables,
• Date-and-time-variables, Data-table-variables,
• Managing-arguments, Using-arguments,
• Data Manipulations,
• Data table ,
• Excel Automation
Managing-variables
• Variable Type
• The data stored within a variable is called a value, and it can be of multiple types.
When you create a variable. the following options are available:
• Boolean - This type has only two possible values: true or false. These variables enable
you to make decisions, and therefore have a better control over your workflow.
• Int32 - This type is used to store numeric information. Some of its uses are to perform
equations, comparisons and pass important data.
• String - Stores text information. This type of variable can be used to store any text-based
information such as employee names, usernames or any other strings.
• Object - Can be used to store different types of data. You can use this type of variable in
situations where you need flexibility for the type of data you store in a variable. Make sure
that the data type used in Object variables is compatible with the activities that use the
variable.
• [Link] - This type can store big pieces of information, and act as a
database or a simple spreadsheet with rows and columns. Can be useful to migrate specific
data from a database to another and extract information from a website and store it locally
in a spreadsheet, among other uses.
• Array of [T] - Enables you to store multiple values of the same type.
• Browse for Types - Allows you to explore more types that can be relevant to your task.
Variable Scope
• The scope property gives variables a well-defined context in which
they can be used.
• The scope can be set to global (available in the entire project), the
current workflow file, or any container activity within the workflow
file.
• You can only create global variables from the Data Manager.
Type-1 :
User (Local) Variables
• User variables are defined by an automation user and used for a
specific task or set of tasks.
• A user variable can hold one value or multiple values.
• Prompt-Assignment (type: String) is a variable that is pre-defined for
use for new automation tasks.
• After you create a user (local) variable, you can initialize it again or
assign it when a task runs.
Type-2 :
System Variables :
• In the System variables, there are pre-defined variables that are provided by
Automation Anywhere.
• System variables are available to be used in all automation tasks.
• Date and Time System Variables – System-related date and time variables.
• System Variables – Loop: Useful in conjunction with Loop commands.
• Excel System Variables – Useful for Excel automation.
• Email System Variables – Useful for Email automation.
• Trigger Variables –Useful in conjunction with triggers.
• PDF System Variables – Useful to be used with PDF command.
• System Variables – Specific to System Settings/Parameters Variables specific to a
particular client machine.
Type-3 :
Credential Variables
• Available in Enterprise edition only from version 10.2.1
• Credential variables store sensitive information that’s used when running
automation tasks.
• Credential variables can be used only by the Bot Creator and only in
Command fields that need a credential input.
• These credentials are defined by the administrator of Enterprise Control Room
in the form of Credential Keys that comprise a set of Attribute Values and are
stored securely in a centralized location – the Credential Vault.
• Unlike User and System variables, you cannot view Credential variables
within the Variable Manager.
• They are visible in the Insert Variable window when you are creating a task
with commands that support Credential Variables.
Generic-value variables
Generic-value variables
• In Robotic Process Automation (RPA), generic-value variables are
used to store and manipulate data that can be reused across different
tasks, processes, or workflows.
• These variables are designed to hold values that are not tied to a specific
data type or context, making them versatile for various automation
scenarios.
• Key Characteristics of Generic-Value Variables:
1. Dynamic Typing: They can hold different types of data (e.g., strings,
numbers, dates, or objects) without requiring explicit type declaration.
2. Reusability: They can be used across multiple steps or processes within an
automation workflow.
3. Flexibility: They allow for easy modification and assignment of values during
runtime.
4. Interoperability: They can interact with other variables, data sources, or
systems seamlessly.
Common Use Cases for Generic-Value
Variables:
•Storing user inputs or configuration values.
•Holding intermediate results during data processing.
•Passing data between different steps or workflows.
•Acting as placeholders for dynamic data retrieved from
databases, APIs, or files.
Best Practices for Using Generic-Value
Variables:
1. Clear Naming Conventions: Use descriptive names to indicate the
purpose of the variable.
2. Data Validation: Ensure the data stored in generic variables is
validated before use.
3. Avoid Overuse: Use specific data types when possible to improve
readability and maintainability.
4. Documentation: Document the purpose and usage of generic
variables for better collaboration.
Text-variables
Text-variables
• In Robotic Process Automation (RPA), text variables are used to store
and manipulate string data, such as words, sentences, or any textual
information.
• These variables are essential for handling text-based operations like
data extraction, manipulation, and communication with users or
systems.
Key Characteristics of Text Variables:

1. Data Type: Specifically designed to store string (text) data.


2. Immutable in Some Cases: In some programming languages or RPA
tools, strings are immutable, meaning they cannot be changed after
creation (instead, a new string is created).
3. Common Operations: Support operations like concatenation,
substring extraction, searching, and replacement.
4. Wide Usage: Used in scenarios involving user input, file content, web
scraping, email processing, and more.
Common Use Cases for Text Variables:
1. Storing User Input: Capturing text entered by users in forms or
prompts.
2. Data Extraction: Extracting text from documents, emails, or web
pages.
3. String Manipulation: Modifying text (e.g., trimming, replacing, or
splitting strings).
4. Dynamic Messaging: Generating dynamic messages or
notifications.
5. File Handling: Reading from or writing to text files.
6. API Interactions: Sending or receiving text data in API requests
and responses.
Best Practices for Using Text Variables:
• Use Meaningful Names: Name variables descriptively (e.g.,
CustomerName instead of Text1).
• Validate Input: Ensure text data is validated (e.g., check for empty
strings or invalid characters).
• Handle Encoding: Be aware of text encoding (e.g., UTF-8) when
working with files or external systems.
• Avoid Hardcoding: Use configuration files or input sources for
dynamic text values.
• Error Handling: Implement error handling for text operations (e.g.,
handling null values or unexpected formats).
True-or-False Variables
True-or-False Variables
• In Robotic Process Automation (RPA), true-or-false variables (also
known as Boolean variables) are used to store logical values, typically
representing True or False.
• These variables are essential for decision-making, conditional logic,
and controlling the flow of automation workflows.
• Key Characteristics of True-or-False Variables:
• Data Type: Boolean (can only hold True or False).
• Binary Nature: Represents two states—True (yes/on/success) or False
(no/off/failure).
• Conditional Logic: Often used in If conditions, loops, and decision-making
steps.
• Simplicity: Easy to use and understand, making them ideal for controlling
workflow logic.
Common Use Cases for True-or-False
Variables
• Decision-Making: Determine the next step in a workflow based on a
condition.
• Example: If a file exists (True), process it; otherwise (False), skip.
• Loop Control: Control the execution of loops (e.g., While or Do-While).
• Example: Continue looping until a condition becomes False.
• Error Handling: Flag errors or exceptions in a process.
• Example: Set a Boolean variable to True if an error occurs.
• State Tracking: Track the state of a process or system.
• Example: Set a variable to True when a task is completed.
• Validation: Validate data or conditions.
• Example: Check if a user input is valid (True or False).
Best Practices for Using True-or-False
Variables:
• Clear Naming: Use descriptive names for Boolean variables (e.g.,
IsFileProcessed, HasError).
• Avoid Overcomplication: Keep conditions simple and readable.
• Default Values: Initialize Boolean variables with a default value (True
or False) to avoid undefined behaviour.
• Document Logic: Document the purpose and usage of Boolean
variables for better understanding and maintenance.
• Combine with Other Variables: Use Boolean variables alongside
other data types (e.g., text, numbers) for complex logic.
Number-variables
Number-variables
• In Robotic Process Automation (RPA), number variables are used to store
numeric data, such as integers, decimals, or floating-point values.
• These variables are essential for performing calculations, comparisons, and
data manipulations in automation workflows.
• Key Characteristics of Number Variables:
• Data Types:
• Integer: Whole numbers (e.g., 1, 100, -5).
• Decimal/Float: Numbers with fractional parts (e.g., 3.14, 0.5, -2.7).
• Precision: Decimal or floating-point numbers can have varying levels of precision.
• Mathematical Operations: Support arithmetic operations like addition,
subtraction, multiplication, and division.
• Comparisons: Used in conditional logic to compare values (e.g., greater than, less
than, equal to).
Common Use Cases for Number Variables:
• Calculations: Perform arithmetic operations (e.g., totals, averages,
discounts).
• Counting: Track the number of iterations, records, or items.
• Data Validation: Validate numeric inputs (e.g., check if a value is
within a specific range).
• Dynamic Values: Store dynamic numeric values retrieved from
databases, APIs, or user inputs.
• Loop Control: Use as counters in loops (e.g., For or While loops).
• Financial Operations: Handle currency, percentages, or other
financial calculations.
Best Practices for Using Number
Variables:
1. Use Appropriate Data Types: Choose the correct type (integer or
decimal) based on the data being handled.
2. Initialize Variables: Always initialize number variables with a default
value to avoid errors.
3. Handle Precision: Be mindful of rounding errors or precision issues
with decimal numbers.
4. Validate Inputs: Ensure numeric inputs are valid and within expected
ranges.
5. Document Usage: Document the purpose and expected range of
number variables for clarity.
6. Error Handling: Implement error handling for operations like division
by zero or invalid conversions.
Common Operations with Number
Variables
[Link] Operations:
•Addition (+), subtraction (-), multiplication (*), division (/).
•Example: 5 + 3 = 8.
[Link]:
•Greater than (>), less than (<), equal to (==).
•Example: Is 10 > 5? → True.
[Link]:
•Round decimal numbers to a specific precision.
•Example: Round 3.14159 to 3.14.
[Link]/Decrement:
•Increase or decrease a value by a specific amount.
•Example: Increment a counter by 1.
[Link] Validation:
•Check if a number falls within a specific range.
•Example: Is 7 between 1 and 10?
Array-variables
Array-variables
• An array variable can be used to store multiple values of the same
type in a single variable.
• An array is useful when you need to perform operations on a
collection of items, such as a list of numbers, strings, or objects.
• Many RPA tools like UiPath, Automation Anywhere, or Blue Prism
provide support for arrays, though the syntax and functionality may
vary slightly between platforms.
When to Use Arrays in RPA:
• When you need to store a series of items, like multiple names or dates,
in a single variable.
• When you're working with lists of data, such as email addresses,
URLs, or product details.
• To automate repetitive tasks that involve collections of data (e.g.,
processing multiple files or records).
General Syntax
• General Syntax (for most RPA tools)
• Declaring an array:
arrayName = New DataType() {value1, value2, value3}
• Accessing array elements:
arrayName[index]
• Looping through an array:
For Each element in arrayName
Date-and-time-variables
Date and time variables
• Date and time variables are used to work with dates and times within
your automated workflows.
• These variables allow you to manage and manipulate date/time
information, such as getting the current date, adding or subtracting
time, and formatting dates to meet specific requirements.
• Different RPA tools provide different approaches to date and time
manipulation, but the general concepts remain the same.
Declaring a DateTime Variable:

To declare a DateTime variable in UiPath, you can either do it via the


"Variables" pane or through an Assign activity.
e.g.
myDateTime = [Link]
• Get Current Date and Time:
CurrentDateTime = [Link]
• Get Only the Date or Time: To extract just the date or time from a DateTime
object:
currentDate = [Link]
currentTime = [Link]("HH:mm:ss")
General Date and Time Operations
•Get the current date and time (e.g., [Link]).

•Extract parts of the date (e.g., day, month, year).

•Add or subtract time (e.g., add 5 days, subtract 2 hours).

•Format the date to a specific format (e.g., MM/dd/yyyy).

•Compare dates to check if one is before or after another.


Data-table/
Data-table-variables
Data tables
•Data tables are structured collections of data organized
in rows and columns.
•RPA bots interact with these tables to:
•Extract data from sources (e.g., Excel, web pages, PDFs).
•Process data (filter, sort, transform).
•Input data into applications or systems (e.g., CRMs,
ERPs).
Common Use Cases for Data Tables in RPA
[Link]/CSV Automation:
1. Read/write data from Excel files.
2. Process invoices, reports, or customer lists.
[Link] Scraping:
1. Extract tables from HTML pages (e.g., stock prices, product listings).
[Link] Operations:
1. Query databases and process results.
[Link] Processing:
1. Extract data from PDF/OCR-scanned tables and populate systems.
[Link] Validation:
1. Compare tables (e.g., validate data between two systems).
Techniques for Handling Data Tables
•Filtering/Sorting:
•Use [Link]() in UiPath or Filter Dataset in Automation
Anywhere.
•Merging Data:
•Combine multiple tables (e.g., Merge DataTables in UiPath).
•Error Handling:
•Validate data types, check for empty cells, and handle exceptions.
•Dynamic Column Mapping:
•Map columns from one table to another using headers (e.g., for
varying input formats).
Example Workflow (UiPath)

1. Read Data: Use Read Range to load an Excel table into a DataTable.
2. Process Data: Loop through rows, apply business logic (e.g., calculate
totals).
3. Filter Data: Use [Link]("Status = 'Pending'") to filter rows.
4. Write Output: Export results to a new Excel file or update a database.
Challenges & Best Practices
• Dynamic Table Structures: Handle tables with variable columns or
headers.
• Performance: Optimize loops for large datasets (e.g., use bulk
operations).
• Data Validation: Ensure data integrity before processing.
• Logging: Track errors and row-level processing details.
Tools & Integrations
• Excel/CSV: Built-in activities in UiPath, Automation Anywhere, etc.
• OCR Tools: Use ABBYY, Google Vision, or Microsoft OCR for
scanned tables.
• Database Connectors: SQL Server, Oracle, or ODBC integrations.
• Web Table Scraping: Use UiPath Web Recorder or Automation
Anywhere MetaBot.
Managing-arguments
Arguments
• Arguments in RPA (especially in UiPath) are used to pass data
between workflows.
• They function similarly to variables, but with a broader scope,
allowing data to be exchanged between different parts of an
automation.
Types of Arguments in UiPath
Each argument has a direction, which determines how data flows:
• In (In) – Used to pass values into a workflow.
• Example: Sending an input (like a customer ID) from a main process to a
sub-workflow.
• Out (Out) – Used to return values from a workflow.
• Example: A sub-workflow processes data and returns the result to the main
workflow.
• In/Out (In/Out) – Used to pass data both into and out of a workflow.
• Example: A process modifies an input value and sends back the updated
version.
• Property (Property) – Used for object-oriented workflows (rarely used in basic
automation).
How to Use Arguments in UiPath
1. Define the Argument
1. Open the Arguments Panel in a workflow.
2. Click Create Argument and set the name, direction, and data type (String,
Int32, DataTable, etc.).
2. Pass Arguments Between Workflows
1. Use the "Invoke Workflow" activity.
2. Assign values to the input/output arguments.
3. Use Arguments Inside the Workflow
1. Inside the invoked workflow, reference the argument just like a variable.
Best Practices for Using Arguments
• Use clear and descriptive names for arguments.
• Keep arguments as few as possible to maintain workflow readability.
• Prefer "In" arguments for constants and "Out" arguments for
results.
• Avoid using In/Out unless necessary (to prevent unexpected
modifications).
Important Questions
• Define a variable in RPA with one example.
• List different types of variables used in RPA.
• State any two naming conventions for variables.
• Identify the purpose of arguments in workflows.
• What is a DataTable in RPA?
• List any two operations performed on DataTables.
• Define recording in RPA and mention its types.
• Apply variables and arguments to pass data between workflows.
• Analyze the role of DataTables in handling structured data.
• Compare different types of variables used in RPA.
Important Questions
• Apply Excel automation to read and write data using RPA.
• Analyze how arguments improve modularity in workflows.
• Evaluate the effectiveness of DataTables in large data processing tasks.
• Analyze different recording types (automatic vs manual) in RPA.
• Design a workflow to process Excel data using variables and DataTables.
• Analyze the selection of appropriate variable types for different automation tasks.
• Evaluate Excel automation techniques for efficiency and accuracy.
• Design an RPA solution for data migration using DataTables and arguments.
• Analyze how recording simplifies bot development in RPA.
• Evaluate different data handling techniques used in RPA workflows.
• Propose a reusable data processing module using variables, arguments, and Excel
automation.

You might also like