Data local operations

This category contains all operations related to local database functionality that can be used in a bot.

Insert to database

Inserts a new row in the given database. Creates the database if it does not exist. This operation has the following properties.

Property name Type Description
Description String Displayed name of the operation. This property is only used in the HMI and has no effect at run-time.
Database name String Name of the database table. This property supports usage of internal bot variables.
Result key String Unique reference to the new row in memory. This property supports usage of internal bot variables.
Scope Enum

Accessibility scope of value in memory specified by the result key reference. The following values are available.

  • Private – value is available only for the current bot.

  • Internal – value is available for the current thread, i.e. for parent bots, for the current bot and for all children executed bots.

  • Shared – value is available for all bots.

Properties Set A set of table columns to create and corresponding row values to insert to the database.

Update in database

Updates the given row in the database. Adds the row if it does not exist. Adds new columns to the database if necessary. This operation has the following properties.

Property name Type Description
Description String Displayed name of the operation. This property is only used in the HMI and has no effect at run-time.
Database name String Name of the database table. This property supports usage of internal bot variables.
Key String Unique reference to the row in memory to update. This property supports usage of internal bot variables.
Scope Enum

Accessibility scope of value in memory specified by the Result Key reference. The following values are available.

  • Private – value is available only for the current bot.

  • Internal – value is available for the current thread, i.e. for parent bots, for the current bot and for all children executed bots.

  • Shared – value is available for all bots.

Properties Set A set of table columns to modify and corresponding row values to update. Other row values remain unchanged. If specified column does not exist it will be added to the database.

Delete from database

Deletes the given row from the database or Deletes all rows corresponding to a given condition. If no row remains in the database, the database file is also removed. This operation has the following properties.

Property name Type Description
Description String Displayed name of the operation. This property is only used in the HMI and has no effect at run-time.
Database name String Name of the database table. This property supports usage of internal bot variables.
Key String Unique reference to the row in memory to update. This property supports usage of internal bot variables.
Condition C# lambda expression

C# lambda expression – function taking the database rows as an input and filtering which rows to delete. This property supports usage of internal bot variables. As an example, the following string can be used to delete all rows having the value of ABC property less than 30.

x => x.ABC < 30. The following string can be used to delete all rows having the value of ABCD property equals to "test".
x => x["ABCD"] == "test"

Find in database

Applies the specified filter on the database rows and saves the selected row in Bot agent’s memory along with the total amount of rows satisfying the given filtering criteria. This operation has the following parameters:

Property name Type Description
Description String Displayed name of the operation. This property is only used in the HMI and has no effect at run-time.
Database name String Name of the database table. This property supports usage of internal bot variables.
Key String Unique reference to the row in memory to update. This property supports usage of internal bot variables.
Key for count String Unique reference to the value in memory. This property supports usage of internal bot variables. Key for count is used to enumerate between multiple rows that satisfy the given filter. Total amount of selected rows is written to the corresponding variable. Further selection can be done by using the index property of the operation.
Scope Enum

Accessibility scope of value in memory specified by the Key reference. The following values are available.

  • Private – value is available only for the current bot.

  • Internal – value is available for the current thread, i.e. for parent bots, for the current bot and for all children executed bots.

  • Shared – value is available for all bots.

Index Integer 1 - based index of the row in the list of rows corresponding to the specified filters. This property supports usage of internal bot variables.
Condition C# lambda expression

C# lambda expression – function taking the database rows as an input and filtering which rows to select. This property supports usage of internal bot variables. As an example, the following string can be used to select all rows having the value of ABC property less than 30.

x => x.ABC < 30

The following string can be used to select all rows having the value of ABCD property equals to "test".

x => x["ABCD"] == "test"

Convert Excel file to database

Converts the Excel file to the local database. The retrieved data types are parsed according to that of the Excel cells. The following types are supported.

  • String - Text

  • Double - Number, Currency, Accounting, Percentage, Fraction, Scientific…

  • DateTime - Short date, Long date, Time…

This operation has the following properties.

Property name Type Description
Description String Displayed name of the operation. This property is only used in the HMI and has no effect at run-time.
Database name String Name of the database table. This property supports usage of internal bot variables.
Source file path String Path to the input Excel file. This property supports usage of internal bot variables. The specified path is relative to the following directory. <projectFolder>\MsgData\Bots
Worksheet name String Name of the worksheet to open. This property supports usage of internal bot variables.
Column name with row unique ids String Name of the column storing the primary keys, i.e. values that uniquely specify a row in a table.
Columns to convert String List of Excel type column ranges that will be converted to the database. Every column range contains a column name (e.g. A) or the first and the last columns (e.g. C:F). Multiple ranges are separated with commas.
Header row Boolean Indicates whether the Excel spreadsheet contains a specific row with column headers. If true, the operation will skip all empty rows until the first row with data and consider this first row as having column headers. If false, all rows will be considered as the raw data.
Drop existing database Boolean Indicates whether the operation should remove the existing database before converting. If true, the existing database file will be removed before conversion. Otherwise, the converted rows will be updated (if the row with same ID exists already) or inserted in the existing database.

Copy database

Creates a copy of the entire database or part of it. This operation has the following properties.

Property name Type Description
Description String Displayed name of the operation. This property is only used in the HMI and has no effect at run-time.
Source database name String Name of the source database table to be copied. This property supports usage of internal bot variables.
Destination database name String Name of the destination database table. This property supports usage of internal bot variables
Overwrite file Boolean Indicates whether the operation should remove the existing destination database before copying. If true, the existing database file will be removed before copying. Otherwise, the copied rows will be updated (if the row with same id exists already) or inserted in the destination database.
Condition C# lambda expression C# lambda expression – function taking the database rows as an input and filtering which rows to copy. This property supports usage of internal bot variables.

As an example, the following string can be used to copy all rows having the value of ABC property less than 30. x => x.ABC < 30

The following string can be used to copy all rows having the value of ABCD property equals to "test". x => x["ABCD"] == "test"

Find files

Applies the specified filter on the list of files and saves the selected file path in the bot agent’s memory along with the total amount of files matching the filtering criteria. This operation has the following properties.

Property name Type Description

Description

String

Displayed name of the operation. This property is only used in the HMI and has no effect at run-time.

Search directory

String

Full Uri path to the search directory. This property supports usage of internal bot variables. The specified path is relative to the following directory: <projectFolder>\MsgData\Bots

Search pattern

String

The search string to match against the names of files in path. This parameter can contain a combination of valid literal path and wildcard (* and ?) characters, but does not support regular expressions.

Order by date

Enum

Order the list of selected files by their modified date. The following values are available.

  • Do not order by date – Order of files is not modified

  • Oldest first – Order the list of files according to their modified date from the oldest to the newest.

  • Newest first – Order the list of files according to their modified date from the newest to the oldest

Index

Integer

1-based index of the file in the list of selected files, i.e. corresponding to the specified filters. This property supports usage of internal bot variables.

Key for file path

String

Unique reference in memory to the full path of the file. This property supports usage of internal bot variables.

Key for file name

String

Unique reference in memory to the name of the file. This property supports usage of internal bot variables.

Key for count

String

Unique reference to the value in memory. This property supports usage of internal bot variables. Key for count is used to enumerate between several files that match the given filter. Total amount of selected files is written to the corresponding variable. Further selection can be done by using the index property of the operation.

Scope

Enum

Accessibility scope of value in memory specified by the Key for file path, the Key for file name, or by the Key for count reference. The following values are available:

  • Private – Value is available only for the current bot

  • Internal – Value is available for the current thread, i.e. for parent bots, for the current bot and for all child executed bots.

  • Shared – Value is available for all bots.

Generate QR code

The Generate QR Code operation allows a user to encode the given text in a QR code image and save it in a file. The image can then be inserted in a report or displayed to a user in SnapVue or PcVue.

Property name Type Description

Description

String

Displayed name of the operation. This property is only used in the HMI and has no effect at run-time.
QR code content String Text to encode in a QR code. A unique GUID is generated if the field is empty. This property supports usage of internal bot variables.
Result file path String Full Uri path to the file for storing the generated QR code. This property supports usage of internal bot variables. If the Overwrite property is not set and a file with the given name already exists, then a new file name is generated. The specified path is relative to the following directory: <projectFolder>\MsgData\Bots
Overwrite Boolean True to always replace the destination file. False to keep the existing files and generate a unique name for the result file.
Key for payload String Unique reference in memory to the generated QR code payload. This property supports usage of internal bot variables.
Key for file path String Unique reference in memory to the generated QR code file path. This property supports usage of internal bot variables.
Scope Enum

Accessibility scope of value in memory specified by the “Key fo ***” reference. The following values are available:

  • Private – value is available only for the current bot

  • Internal – value is available for the current thread, i.e. for parent bots, for the current bot and for all children executed bots

  • Shared – value is available for all bots