Error in flowchart for GmailMessages

I designed a flowchart with
Step 1. Get Mail Messages (MaxReesults=1) SearchExpression “is: unread subject:test4site”
Step 2. Assign url=mail4newsite(0).Subject.TrimStart(“somechar”)
Step 3. Assign subdom=url.TrimStart(“somechar”).TrimEnd(“somechar”)
Step 4. Read Range (from Gsheets)
Step 5. For Each Row in dt (Is Match > If Then > do some tasks)
Step 6. Assign success=true
Step 7. True loop back to Step 1. False show warning

What I expect is, when there are several emails matched SearchExpression, each mail will go through Step 2~5 and loop back to next email to start over.

The process ran successfully for the first email, but got error for the 2nd email as following, any suggestion? Thanks

RemoteException wrapping System.IndexOutOfRangeException: Index was outside the bounds of the array.
at lambda_method(Closure ,
ActivityContext )
at Microsoft.VisualBasic.Activities.VisualBasicValue1.Execute(CodeActivityContext context) at System.Activities.CodeActivity1.InternalExecuteInResolutionContext(CodeActivityContext context)
at System.Activities.Runtime.ActivityExecutor.ExecuteInResolutionContext[T](ActivityInstance parentInstance,
Activity1 expressionActivity) at System.Activities.InArgument1.TryPopulateValue(LocationEnvironment targetEnvironment,
ActivityInstance activityInstance,
ActivityExecutor executor)
at System.Activities.RuntimeArgument.TryPopulateValue(LocationEnvironment targetEnvironment,
ActivityInstance targetActivityInstance,
ActivityExecutor executor,
Object argumentValueOverride,
Location resultLocation,
Boolean skipFastPath)
at System.Activities.ActivityInstance.InternalTryPopulateArgumentValueOrScheduleExpression(RuntimeArgument argument,
Int32 nextArgumentIndex,
ActivityExecutor executor,
IDictionary2 argumentValueOverrides, Location resultLocation, Boolean isDynamicUpdate) at System.Activities.ActivityInstance.ResolveArguments(ActivityExecutor executor, IDictionary2 argumentValueOverrides,
Location resultLocation,
Int32 startIndex)
at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor,
BookmarkManager bookmarkManager,
Location resultLocation)

Can you post what you have in the sequence get mail messages?

Hi @HareeshMR

Not sure whether just upload this file will be enough or not, please correct me what should be better.

Thanks for your help.Flowchart4getmail.xaml (34.2 KB)

I’m getting error while trying to open the workflow, can you zip the workflow along with project.json and upload?>

I’m out of office already, can do it after arriving home, but I think it should be missing gsuite dependency.

here is the zip (19.3 KB)