LogoLogo
  • Welcome to Tailent Automation Platform documentation
    • Start for Free
  • Getting Started
    • State Machine Approach
    • TAP Studio
      • How to install TAP Studio
      • TAP Studio Overview
      • Variables and Data Types
      • Transitions
        • Normal transitions
        • Exception transitions
      • How to Create a New Automation Project in TAP Studio
      • How to add an Activity to Favorites
      • How to Open an Existing Automation Project in TAP Studio
      • How to Save an Automation Project
      • Control Identifiers in UI Browser
      • List of Activities that use Control Identifier as Input Parameter
      • Press Key - Values of Key parameter
      • Outlook vs standard IMAP protocol
      • Hardware & Software Requirements TAP Studio
    • TAP Assistant
      • Basic Scheduling
      • Setting Custom Log Sizes
    • TAP Frequenty Asked Questions
  • Actions
    • TAP Actions
      • CSV
        • Append CSV
        • Read CSV
        • Write CSV
      • Application
        • Kill Process
        • Start Process
        • Wait for Control
      • Clipboard
        • Get Clipboard Text
        • Set Clipboard Text
      • Control
        • If Control Exists
        • Wait for Control to Disappear
        • Check Control
        • Select List Item
        • Set Focus
        • Set Text
        • Get Value
        • Get Native Value
        • Get Window State
        • Set Window State
      • Custom
        • C# Script
      • Data
        • JSON Deserialization
      • Database
        • Connect To Database
        • Database Query
        • Database Non Query
        • Disconnect From Database
      • Diagram
        • Invoke Workflow
        • Sequence
      • Direct text
        • Click Text
        • Extract Direct Text
      • Excel
        • Write Table
        • Set Range Color
        • Rename Sheet
        • Read Range
        • Read Cell Formula
        • Insert Rows
        • Insert Columns
        • Format Range
        • Fill Rows
        • Fill Columns
        • Delete Sheet
        • Delete Rows
        • Delete Columns
        • Create Sheet
        • Clear Range
        • Open Excel WorkBook
        • Close Excel WorkBook
        • Get Cell Value
        • Set Cell Value
      • Flow
        • Assign Value
        • Show Message Box
        • Wait
      • Loging
        • Log to FIle
        • Write to Console
      • IO
        • Copy File
        • Create Directory
        • Create File
        • Delete Directory
        • Delete File
        • Move File
        • Read Text File
        • Write To File
      • Keyboard
        • Press Key
        • Type Text
        • Type Password
      • Mail
        • Get Email Messages
        • Move Mail Message
        • Save Email Attachment
        • Get Outlook 365 Emails
        • Save Outlook 365 Attachments
      • Mouse
        • Click Control
        • Click Point
        • Move Mouse
        • Move to Control
        • Click Image
      • Office
        • Word.Replace
        • Get Word Page Count
      • PDF
        • Extract Sections from PDF
        • Get PDF Page Count
        • Read text from PDF
      • UI
        • Assign Control Identifier
      • User
        • Choose File
        • Choose Folder
        • User Input Dialog
      • Visual
        • Get Image
        • Extract Text
      • Web
        • Wait for Page
        • Run JavaScript
        • Wait for Element Attribute
        • Set Element Text
        • Get HTML Element
        • Open Browser
        • Click Element
        • Get HTML
        • HTTP REST Request
      • ZIP
        • Add to ZIP
        • Extract ZIP
  • TAP Release Updates
    • Release Updates
      • TAP Release Notes 24.8
      • TAP Release Notes 24.01
      • TAP Release Notes 21.12
      • TAP Release Notes 21.10
      • TAP Release Notes 21.06
      • TAP Release Notes 21.04
      • TAP Release Notes 21.02
      • TAP Release Notes 20.12
      • TAP Release Notes 20.11
      • TAP Release Notes 20.09
  • Use Cases
    • Use Cases
      • TAP Studio - Define Invoices Naming Convention
      • TAP Studio - Extract Accounting Data from Invoices
      • TAP Studio - Control Identifier Fine Tuning
      • TAP Studio - Move File
      • TAP Studio - Download Invoices from Email and Move Emails
      • TAP Studio - How to input invoice data into an Accounting System
      • TAP Studio - How to open all desired files of a certain type in a folder
      • TAP Studio - How to parse a custom excel date format without errors
  • Knowledge Base
  • Scripting Utility Classes
    • Tailent.Control Class
      • Tailent.Control.ControlExists
    • Tailent.Console Class
      • Tailent.Console.WriteLine
    • Tailent.StringUtils Class
      • Tailent.StringUtils.FuzzSetMatching
    • Common Scripts Repository
      • C# Scripts Repository
        • Read Excel
        • Write Excel
        • Add LOV in Excel
        • Change Excel Cell Color
        • RegexSplit (Text Filtering)
        • Start a process
        • Filter HTML Contents
        • Reading CSV Contents
        • LINQ Filtering
        • Data Conversion
          • Double to DateTime
  • Solution Migration
  • Microsoft 365 Automation
    • Creating an application Instance
  • Remote Desktop Automation
    • Setting up the remote context
  • Knowledge Base
    • Configuring Proxy Servers
    • tap.runtime.config - Debug flag
    • Unblocking Action .dll Files
Powered by GitBook
On this page
  • 1. What is a Variable
  • 2. Data Types
  • 3. How to create a new variable

Was this helpful?

  1. Getting Started
  2. TAP Studio

Variables and Data Types

1. What is a Variable

Variables are containers that can hold one or multiple data entries of the same data type.

For example, the variable companyName can be a variable that holds the value "Tailent".

The value of a variable can change:

  • through an external data input.

  • passing from one activity to another throughout the automation project.

  • data manipulation.

2. Data Types

As we mentioned above, variables can hold data entries of the same data type, so let's see what data types are available.

TAP Automation supports all C# data types, but the most common are:

String: - stores a sequence of characters, surrounded by double quotes; e.g. "Alpha Corporation"

Integer - stores whole numbers from -2,147,483,648 to 2,147,483,647; e.g. 14

Double - stores fractional numbers. Sufficient for storing 15 decimal digits; e.g. 14.25

Boolean - stores true or false values; e.g. true

DateTime - represents an instant in time, typically expressed as a date and time of day; e.g. 12.14.2019

Other data types are collections of objects. Each object of a collection is identified through its index in the collection. Some of the most encountered collections are:

  • Array - ArrayOf<T> is used to store multiple values of the same data type. The size (number of objects) is defined at creation and can't be changed throughout the workflow. e.g. {"Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"}

  • List - System.Collections.Generic.List<T> is used to store multiple values of the same data type, just like Arrays, but its size is dynamic, meaning that we can add or remove the object(s) from the list throughout the workflow e.g. {"Alpha Corp", "Beta Inc.", "XYZ SA"}

  • Dictionary - System.Collections.Generic.Dictionary<TKey, TValue> is used to store objects in the form of (key, value) pairs. Keys and Values can be of a separate data type. e.g.

{
   {"UK", "London, Manchester, Birmingham"},
   {"USA", "Chicago, New York, Washington"},
   {"India", "Mumbai, New Delhi, Pune"}
}

3. How to create a new variable

Go to the variable section and click on the + button:

A new line will appear and we have to set the variable name, value type, and default value. The first 2 are mandatory and the 3rd one is optional.

Name - It should be as descriptive as possible to make your automation easy to read by other developers or even for yourself after a while.

Variable type - select from the drop-down list the data type of your variable.

If the data type you are looking for is not in the list, click on choose type...

The window "Variable Construction - Select Type" will pop up and here you can search for the data type you are looking for, like MailMessage

PreviousTAP Studio OverviewNextTransitions

Last updated 10 months ago

Was this helpful?

We recommend article about data types in C#

Default Value - usually, variables have initial values that change throughout the automation process. If no default value is assigned when the variable is created, there is generally an activity that sets a value afterward.

this
Assign Value