Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

This example will prompt the user for an Excel file. Then loop through the rows and enter them into a website. This website has controls that move every time the page is refreshed, but not to worry, Aura can handle this easily!

Code Block
Prompt User "Please upload your Excel file" $myExcel -excel//This folder is in My Documents\Digital Workforce\Aura Digital Worker\Assets\
//This path is used to locate files and folders or you can also specify a full path below
$excelFile = ""
$folder = "Test Data"
$rpasite = "http://www.rpachallenge.com/"
navigate to $rpasite
foreach ($excelFile in $folder)
{
foreach ($row in $myExcel$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
//The parameter -forcedetection is used because each time the Submit button is clicked, the position of controls change
//This is used to tell Aura to force redetect the screen controls
//Normally, without this parameter, Aura can detect screen changes automatically, but we want to be sure to force this here
Enter $FirstName
Enter $_FirstName as "First Name" -forcedetection
Enter $LastName$_LastName as "Last Name"
Enter $PhoneNumber$_PhoneNumber as "Phone Number"
Enter $CompanyName$_CompanyName as "Company Name"
Enter $RoleInCompany$_RoleInCompany as "Role in Company"
Enter $Email$_Email as "Email"
Enter $Address$_Address as "Address"
Click "Submit" button -nearest("address")
//We are finished inputting values, swith to Excel application/file to update a value
switch to $myExcel$excelFile
Set value "Is Completed" as "Yes"
}
//This will add the result to be sent back to the user to open once workflow auttomation is complete.
//We could also use copy or move commands to copy files to another location
//The files are stored on Aura Worker if needed
Add Result $excelFile
}

Resources

View file
namechallenge.xlsx

...