I’m trying to crack the practice 1 with the walkthrough provided by academy.
Since I don’t have Outlook account, so the Outlook activity is changed to IMAP activity throughout.
After running the workflow, I’ve received 1 exception related to “if” clause.
Here is the full exception:
"Session 11 has thrown an exception
Message: Object reference not set to an instance of an object. This error usually occurs when using a variable with no set value (not initialized).
Exception Type: NullReferenceException
System.NullReferenceException: Object reference not set to an instance of an object.
at lambda_method(Closure , ActivityContext )
1.Execute(CodeActivityContext context) at System.Activities.CodeActivity1.InternalExecuteInResolutionContext(CodeActivityContext context)
at System.Activities.Runtime.ActivityExecutor.ExecuteInResolutionContext[T](ActivityInstance parentInstance, Activity
1 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, IDictionary
2 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)"
So, I debugged a bit myself.
What I can confirm are the following:
- The “Get IMAP mail” activity works fine, since I can print out the mail 1 by 1
- The “Read range” activity works fine, as above
My suspicion is that the variable “mail”, which was a temporary variable set in the “For each” activity, doesn’t work inside the “For each row” activity.
(The “For each row” activity is wrapped within the “For each” activity)
Here is the screenshot of the workflow:
Anyone has encountered a similar issue?