I get this error once I try to finish the training part 4. It’s not clear to me what I’m doing wrong, even though I have looked at it, and started from scratch, several times.
Message: Object reference not set to an instance of an object.
Exception Type: System.NullReferenceException
An ExceptionDetail, likely created by IncludeExceptionDetailInFaults=true, whose value is:
System.NullReferenceException: Object reference not set to an instance of an object.
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)
this error usually occurs when the object been referred and used in assign activity has null value in it or no value in it
kindly check once with the assign activity in the right side variable is been with value or not
Cheers @Sondergaard
Kindly check whether the variable PN is getting value from Get OCR text,
Use a write line activity next to Get OCR Text activity and check with the output panel with output buddy
if no value get ocr text didn’t fetch any value or
if we get the value, kindly change the scope of the variable PN in the variable panel to whole sequence
Cheers @Sondergaard
No Worries
–we got an output from Get OCR text activity, with a variable named PN
–next to this Get OCR text activity use a Message box ACTIVITY and mention the input as PN.ToString
–if we are able to see any output with the text obtained from get OCR text activity then we are fine, so now we just need to change the scope of the variable, the variable scope can be changed by going to the variable panel in bottom of studio, click it and change the scope value by selecting the whole sequence name in the drop down list and run again it will work
or
–if we are not getting any output , then the Get OCR text activity does not give any value at all, we need to select again the text with a new Get OCR Activity
Sorry - I still don’t get it. The things you want me to do, is more advanced than the starter tutorial. Can you please check the Academy starter tutorial in stead? I’m following the steps notoriously, so I really can’t understand what’s missing.
Fine
it should be like this, just on where to place the write line activity, dont take the other activities terms,
we can even use message box instead of writeline and mention the same as input
if we are not getting any value then the get text didn’t get any value
of
if we are getting any value, go to the variable panel highlighted at the bottom left and change the variable PN scope as whole sequence name in the drop down list @Sondergaard
Kindly try this and let know buddy
Now you have used message box
So when the bot runs we will be getting a small popup window with the value of PN variable…
Where i told to check the output panel with values ONLY WHEN WRITE LINE ACTIVITY is used…
So you are going good.
Now run the bot, we will be getting the value using get ocr text and that output will be displayed by this message box…if any value is displayed, we just need to change the scope of the variable PN in the variable panel
Or
If no value gets displayed, get ocr text is not getting any value when the bot runs
Kindly try this and let know buddy
Cheers @Sondergaard
Fantastic buddy
Changing the scope means when we place a activity inside a sequence (usually we call Sequence a CONTAINER), the variable inside those activities will be accessible only inside that container, like a local variable, while if the variable in those activity is changed with the scope in the variable panel, to the whole sequence that is the whole container name, that variable will be accessible in all the activities and in all the container within the main container, like a Global variable, (i mean the container as a sequence, like here DO is a container, where we have activities like Get OCR Text and Message box,)