If Condition does not work

Hey Guys,

I have the problem that the following condition doesn’t work.
If the list “StichtagDateien” has at least one entry then do the assign activity.
You can see that the property value of the list contains [0] = null but the Else path won’t taken.
What I have to change that it jumps to the else path if the list has no entries like that.

Thank you for your help.

I didn’t get your question exactly.
Your list always contain one value. If it is null, you have to jump to else loop. Is my understanding correct?
If yes, in that case use the following condition in the IF -

if v_Lstr_StichtagDateien.Count > 0 And v_Lstr_StichtagDateien(0) != null Then
   //value is not null
   //value is null

Hi @Akimbow

Make sure that you are not counting the headers in your Count on if condition, because this may be your problem.

Or you can change the If condition to v_Lstr_StichtagDateien.Count > 1 since you always have the headers and your count will be Always 1 :smiley:

Hope it helps you out o/

Hi Karthik,

thank you for your quick response. Yes, your understandig of the condition ist correct but I didn’t get your solution exactly.

Is my condtion correct like this, because something is missing:


Sorry if I am a little stupid but I am an absolute RPA beginner and have no background in programming.

Hey Yan_Boos,

thanks but I have no headers in the list because it is no datatable. The Point is that my further activities are reading a Folder and there are files inside. If the Folder is not there or empty than the list has no entries and the conditon should be jump to the Else path (Throw exception).

What is the error message?Can click that <!> symbol and let me know the error message?


The last 2 words are in german, I hope it doesn’t matter. :slight_smile:

Do you have any idea? Unfortunately I don’t know how fix it.

Hi Akimbow ,
i had the same problem and i write not anymore “!=” this Condition. Also it is more better , if you write
(Not v_Lstr_StichtagDatetin = null) —> this is equals to “!=”
Maybe you can try with this