Hi everyone, i need help.
I have been trying to make a Robot, clothing consultant in UiPath studio. The Robot ask in the begning the name of a city. then it types the name of city in browser, check the weather in that city and in the end suggest the clothes according to weather. I have used Flowchart with three options. For each option, I have used Flow decision activity.
In the first Flow decision(check for rain) I wrote this: Weather.Tolower.Contains(“rain”)or Weather.Tolower.Contains(“shower”)or Weather.Tolower.Contains(“thunderstorm”)
For second Flow Decision (check if too cold) I coded: Temperature<40
For the third one (if too hot) I coded: Temperature>80
As i tried to run the Robot, it ask the city name, type it in to browser get the weather than stop executing and shows following error:2024-12-03T23:00:00Z
Runtime execution error"
Source : VisualBasicValue
Message: Object reference not set to an instance of an object.
Exception type: System. NullReferenceException
12/04/2024 20:09:06 => [Debug] Execution started for file: Main
12/04/2024 20:09:07 => [Info] Robot1_ClothingConsultant execution started
12/04/2024 20:09:20 => [Debug] Frankfurt
12/04/2024 20:09:20 => [Debug] Audit: Using Web App. Browser: Edge URL: https://www.google.com/
12/04/2024 20:09:24 => [Error] VisualBasicValue: Object reference not set to an instance of an object.
12/04/2024 20:09:24 => [Info] Robot1_ClothingConsultant execution ended in: 00:00:17
12/04/2024 20:09:25 => [Error] System.NullReferenceException: Object reference not set to an instance of an object. at Namespace_fa4c.Main_Expressions.Main_Expressions_TypedDataContext2_ForReadOnly.__Expr3Get()
at Namespace_fa4c.Main_Expressions.Main_Expressions_TypedDataContext2_ForReadOnly.ValueType___Expr3Get()
at Namespace_fa4c.Main_Expressions.InvokeExpression(Int32 expressionId, IList1 locations, ActivityContext activityContext) at Microsoft.VisualBasic.Activities.VisualBasicValue1.Execute(CodeActivityContext context)
at System.Activities.CodeActivity`1.InternalExecute(ActivityInstance instance, ActivityExecutor executor, BookmarkManager bookmarkManager)
at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor, BookmarkManager bookmarkManager, Location resultLocation
Hi, you can add Log Messages and print the variables/arguments.
You can also, use the ‘Watch/Immediate/Local’ panels, however you need to add breakpoints
Hi, thanks for reply, I have used “Assign activity” to assign variables. I have checked all coding thoroughly once again, but it is still giving the same error:
Message: Object reference not set to an instance of an object.
Exception Type: System.NullReferenceException
System.NullReferenceException: Object reference not set to an instance of an object. at Namespace_b35e.Main_Expressions.Main_Expressions_TypedDataContext2_ForReadOnly.__Expr3Get()
at Namespace_b35e.Main_Expressions.Main_Expressions_TypedDataContext2_ForReadOnly.ValueType___Expr3Get()
at Namespace_b35e.Main_Expressions.InvokeExpression(Int32 expressionId, IList1 locations, ActivityContext activityContext) at Microsoft.VisualBasic.Activities.VisualBasicValue1.Execute(CodeActivityContext context)
at System.Activities.CodeActivity`1.InternalExecute(ActivityInstance instance, ActivityExecutor executor, BookmarkManager bookmarkManager)
at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor, BookmarkManager bookmarkManager, Location resultLocation)
@Shabana_Anjum ,
Sorry I’m editing my response after re-reading the debug output.
If you are using an integration to get a list of something (weather, locations etc), make sure the authentication works.
Hi, thanks for reply I really appreciate it. How can I make sure about authentication?
I would like to summarize: It is a Robot which get the temperature and weather of the city, which we enter in the message box. The robot type this city name in browser get the temperature and weather in that city and suggest the suitable clothes and other thing according to weather. I have been using following variables : CityName, as strings type, Temperature, as an integer type, Weather as a string type, RainGear as string type and OutfitSuggestions as string type. All variables are in “Main Scope” so that they can be accessed over all. I have been using Flowchart and Flow decision (true, false). When I run this Robot, it works to Flowchart ( I mean it type the city name in browser and get temperature and weather successfully, but after that it stops and throw error.
Temperature can be high or low, I mean I can give a specific value, initialize it. Same is the case with other variables Weather, RainGear, CityName and OutfitSuggestions etc. I hope I could be helpful for you to understand the problem.
I need help.
Thanks
You have a code block/activity named “Edge Google” before the flow chart, where I believe you get the weather data for the selected city. From that code block, you assign values to variables in the process.
You then use those variables in the flow chart logic. It is important to make sure that all variables used in the flow chart are not null. For now, you can log those variables before the flow chart is executed. In a live environment, you would do sanity checks within the flow chart before using those variables in flow decisions.
Hi, thanks for detailed reply. My question is: how can apply sanity checks inside the flowchart. I mean which activity is used for this purpose and where should I drag this? Flowchart is connected with arrow to Flow decisions and Assign Activities. If I make a sanity check, how would it be possible?
Kindly explain me with an example. I am unable to solve this problem on my own.
Best regards
Shabana