I’ve been stuck on this issue for awhile and would definitely appreciate some assistance!
I am using Powershell to pull a customer name from an email subject using regex; then wanting to pull the result back into UiPath for reporting later on.
UiPath is reading and storing the email subject into a variable that I am then trying to pass into Powershell as an argument.
PScode:
$pattern = "Paycheck Protection Program documents for (.+), Received "
$args[0] -match $pattern | Out-Null
$Matches[1]
But am still getting “Cannot index into a null array” error every time it hits the Invoke Power Shell activity.
Example subject (EmailSubject): From Payroll Protection Admin via DocuSign, Subject Paycheck Protection Program documents for Scarlett Segura , Received 5:49 PM, Size 50 KB, Flag Status Unflagged,
Example customer name result(Regex): Scarlett Segura
You can do it with upath as well instead of powershell. All you want to get sender name?
You can use below workflow. You can set the values of “get outlook mail activity” into config file to make it more dynamic and configurable.
Note: Add email subject into filter of "get outlook mail activity.REGNU_File_Download.xaml (6.1 KB) "
No, I only get the null array error from UiPath,
This is the full exception:
RemoteException wrapping System.Management.Automation.RuntimeException: Cannot index into a null array.
at System.Activities.Statements.Throw.Execute(CodeActivityContext context)
at System.Activities.CodeActivity.InternalExecute(ActivityInstance instance,
ActivityExecutor executor,
BookmarkManager bookmarkManager)
at System.Activities.ActivityInstance.Execute(ActivityExecutor executor,
BookmarkManager bookmarkManager)
at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor,
BookmarkManager bookmarkManager,
Location resultLocation)
However, I am just calling the code from it’s saved location rather than with the additional Read Text File activity. I am also leaving the IsScript unchecked and everything is working as desired.