/
Create a Datatable and add rows
Create a Datatable and add rows
Home | Categories | How-to-Articles | Command Reference | Examples | Troubleshooting | Cognillo.com
Use this page to find example workflows for Genta Automation.
Script
This example will create a datatable and add columns and rows to it.
Create Datatable $table
Add Datatable Columns "Name", "Phone", "Email"
Add Datatable Row "John Doe", "646-234-0909" , "jdoe@contoso.com"
Add Datatable Row "Jane Doe", "416-234-0909" , "jdoe@contoso.com"
Foreach ($row in $table)
{
//You can access data in a datatable by row index.
Show Message Box "User is {$row[0]}"
Show Message Box "Their email is {$row[2]}"
Show Message Box "Their phone number is " + $row[1]
//You can also access data by column name for the current row.
//Add Pause below to see the auto-generated variables you can use, then remove the pause.
Pause
Show Message Box "User has name {$_Name}"
}
//Stores results to the 'Result Package'.
Add Result $table
//Send the results from the Result Package to a location.
//This will sends the results to the Genta Desktop user.
Send Results to Genta Desktop
//You could also save all the results that were addeded to a folder on the Genta Worker.
//Send Results to "D:\data\".
Related Articles
Filter by label
There are no items with the selected labels at this time.
, multiple selections available,
Related content
Nested Loop
Nested Loop
More like this
Loop folder with multiple Excel files and processes
Loop folder with multiple Excel files and processes
More like this
Go to a website with tabular data, export to Excel
Go to a website with tabular data, export to Excel
More like this
Simple While Loop
Simple While Loop
More like this
Open the Calculator App and enter values
Open the Calculator App and enter values
Read with this
Go to a website and enter values
Go to a website and enter values
More like this