/
Nested Loop
Nested Loop
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 loop Excel files in a folder, then iterate the rows in each Excel file to input into a form.
//This folder is in My Documents\Digital Workforce\Genta Digital Worker\Assets\
//This path is used to locate files and folders or you can also specify a full path below
//$excelFile = ""
$folder = "C:\\Test Data"
$rpasite = "http://www.rpachallenge.com/"
navigate to $rpasite
foreach ($excelFile in $folder)
{
foreach ($row in $excelFile)
{
//Variables in foreach loops are auto-generated
//Use inspector to get variable names,
//they will be the column headers without spaces and special characters
switch to $rpasite
Enter $_FirstName as "First Name" -forcedetection
Enter $_LastName as "Last Name"
Enter $_PhoneNumber as "Phone Number"
Enter $_CompanyName as "Company Name"
Enter $_RoleInCompany as "Role in Company"
Enter $_Email as "Email"
Enter $_Address as "Address"
Click "Submit" button
log "click"
//When you are finished inputting values, swith to Excel application or file to update a value
switch to $excelFile
Set value "Is Completed" as "Yes"
}
//This will send the result back to the user to open once workflow automation is complete.
//You could also use copy or move command to copy files to another location
//The files are stored on Genta Worker if needed
Add Result $excelFile
}
//Below will send the results to Genta Desktop Assistant
//Look for a button labeled "Open Results" to open the exported results
Send Results to Genta Desktop
Related Articles
Filter by label
There are no items with the selected labels at this time.
, multiple selections available,
Related content
Simple While Loop
Simple While Loop
Read with this
Loop by using @Split
Loop by using @Split
Read with this
Looping files in a folder
Looping files in a folder
More like this
Loop folder with multiple Excel files and processes
Loop folder with multiple Excel files and processes
More like this
Create a Datatable and add rows
Create a Datatable and add rows
More like this
Get Element Collection
Get Element Collection
Read with this