Variable not initialized

Good Afternoon colleagues!

At the moment I’m doing a bot that needs to go to imdb, read excel and distinguish from movies and series. And accordingly to that it will extract different properties. I’m already finishing it but I encountered a problem, which is:

  • some movies do not have, for example, sinopse, and what happens is that when the bot is extracting : “sinopse”, “rating”, “year” and “duration” and it comes the movie that does not have sinopse yet it gives me a error. how can i write in uipath saying :

" if inside movie do not find X element, extract the others anyway and put a blank space on the sinopse row? "

could y help me? i have screenshots helping understand the workflow, if needed




You can set the activity Get Text to ContinueOnError to True

This will then skip if it is unable to find but you will need to check if the string value is empty or not before doing some string manipulation.

I enabled “continue on error” and now appears this:

You are trying to use the variable movie_sinposise but nothing is assigned - so you need to check first if the variable is empty or not before you try and work with it.

String.IsNullOrWhiteSpace(movie_sinopsis) inside an if statement should sort that

If it is empty - just assign it to an empty string movie_sinopsis =" "

1 Like

thank you a lot! really. i solved with default initialization : " "

have a great day

1 Like

Great you managed to get it working! :smiley:

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.