Exception Handling in UiPath | Null Reference full explanation | yellowgreys | YouTube
Aug 14, 2023
Exception Handling in UiPath | Null Reference full explanation | yellowgreys | YouTube
This video provides a full explanation of Null reference exception handling in UiPath. Refer: Exception Handling Selector Not Found : • Exception Handling in UiPath | Try Ca… Refer: Exception Handling Selector Not Found / Try / Catches/ Finally : • Exception Handling in UiPath | Try Ca… #ExceptionHandling # Nullreference#UipathExceptionHandling ABOUT OUR CHANNEL YellowGrey is the learning destination that helps every individual acquire the skills they need to compete in today’s world. Check out our channel here: / yellowgreys Don’t forget to subscribe! FIND US AT Website: http://www.yellowgreys.com/ GET IN TOUCH Contact us at [email protected] FOLLOW US ON SOCIAL Get updates or reach out to Get updates on our Social Media Profiles! Website: http://www.yellowgreys.com/ Instagram: https://www.instagram.com/yellow_greys/ Facebook: https://www.facebook.com/yellowgreys/ Twitter: https://twitter.com/yellowgreys1 Linkedin: https://linkedin.com/in/yellowgreys
Content
0.64 -> Hello Everyone!
1.64 -> Welcome to yellowgreys,
2.64 -> In this video, we are going to learn about
Null Reference exception in UiPath.
17.31 -> Already I have explained selector not found
exception in my previous video,
22.64 -> if you want to refer to selector not found
exception watch it and also i have given the
28.619 -> link below in the description.
32.3 -> Before, we get into practice, let's see what
is NULL Reference.
36.68 -> Usually, this null reference is derived from
the system.
45.05 -> exception and it will occur when using a variable
with no set value or the variable not initialized.
56.879 -> Initializing a variable it can prevent null
reference errors down the line.
63.519 -> There are so many variables types required
to initialize.
69.439 -> For Example.
71.22 -> List
Dictionary
73 -> These are a couple of variables that require
you to initialize them.
79.39 -> Generally, when it comes to a variable, there
are two different ways of initializing them.
83.75 -> one is the Implicit method
another one is an Explicit method
92.27 -> What is the implicit method?
94.689 -> Assume that you have created a variable and
you have used an assign activity and you are
103.45 -> giving a value to it.
107.27 -> This means during process execution you are
providing value to them.
114.42 -> Okay.
115.42 -> Next
116.42 -> What is Explicit Method?
118.49 -> While you are declaring a variable you are
giving a default value to it.
126.42 -> Right?
127.42 -> it means you are initializing it.
132.04 -> i hope you understood the difference between
Implicit and explicit.
136.48 -> now come to the practical session of null
reference.
140.519 -> Now, look at this screen.
144.91 -> i will create a workflow that is relevant
to initialize the variable.
150.56 -> Drag and drop an assign activity and press
ctrl+K to create a dictionary variable.
162.39 -> I am going to create a variable name as DictAge,
which means i am storing someone's age into
171.79 -> a dictionary variable.
173.39 -> Now we have declared the variable but if you
look at this variable type in the variable
181.55 -> panel, still it is showing as a string.
186.45 -> Right?
187.45 -> Let me change this into Dictionary variable
type, to do that.
193.28 -> Click on the variable type and select browse
for types
199.58 -> and select the system.collections.generic.Dictionary
key-value pair.
214.12 -> After Selection, select the key as a string
because the key was the name.
230.26 -> and select the value as Int32, since we have
the value as Integer. which we are referring
238.97 -> as age of the person.
241.45 -> Then click on ok
245.92 -> Once you declared the dictionary type, go
and assign the value.
250.26 -> Click on the assign activity and select to
field, here you have Already declared dictionary
259.64 -> value, now i will add the key to this dictionary.
264.9 -> Let's add the key name as Rohit within the
open and close bracket with double-quotes.
271.8 -> and click ok
283.67 -> then add the age into the value field, Let's
say 27, and click on ok.
292.83 -> Now we have declared the key and value to
the field.
298.35 -> simply add one more activity to store one
more dictionary value.
303.25 -> Since we know that we can store multiple key-value
pairs in a dictionary.
308.54 -> Drag and drop an assign activity and call
the dictionary variable and add the key name
315.98 -> as Raju within the open and close bracket
with double-quotes.
335.68 -> and add his age as 35 as value.
340.39 -> Now, everything is done.
343.18 -> Let's run this project to see what will happen.
348.96 -> The bot is unable to execute because there
is an Run Time execution error.
361.83 -> and exception type is system.NullReferenceException
366.44 -> When an error appears on the screen, you have
to look at which variable creating the issue,
376.84 -> That is one of the best ways to check the
issue.
379.87 -> Now click ok
381.39 -> Let's see how to handle this error.
383.81 -> to handle this go to your variable panel
look at here everything is correct, including
393.16 -> variable name and variable type.
397.19 -> In this case, the only thing is we missed
to initialize the variable, okay
404.41 -> Now, let's initialize the variable in the
default field as a new Dictionary(of string,
421.91 -> int32) within brackets.
430.83 -> Now, everything is perfect.
439.3 -> Let's run the bot or debug again and to see
the bot performance.
446.19 -> Now, everything is ran successfully without
any exception.
453.24 -> That means we cleared Null reference exception
and also you are clear about what is null
461.17 -> reference exception.
463.59 -> This is one of the examples to understand
the Null Reference exceptions.
468.29 -> Thank you for Watching!
471.04 -> Please do subscribe and support !!
Connect with us for more tutorials.
Source: https://www.youtube.com/watch?v=31VzM0WRT58