Replace Null ienumerable value

Hi All,

Me not being able to resolve this may be my lack of knowledge so apologies.

I am scraping information from a text output using Regex, ell except 1 part is working
There is a particular pattern I am using that looks for the word ‘self’ ( I have set this match result as selfMatch)
I have an if statement that if the selfMatch is true then output a new match (contactMatch).
When the text I am scraping has the ‘self’ as true its all fine.

When there is no ‘self’ I want to set the output value to be ‘0’. The value is an ienumerable that I am the creating as an array in a for each row

I put in the else option to reset the value, this seems to reset it but its still a NULL value, below is when the 'selfMatch value is not true, the next picture is when I reset the value.



I scrape all the other data then go to assign the array value to a array of string, this is where the issue of the null value is.


Note: I only get this error when 'selfMatch is not true.

So I figure I need to put in a value, I would like to assign ‘0’

Could someone please provide assistance how I do this.
I have uploaded the body of the xaml so you can see what i am trying to do, please note its not the full xaml but its the part i am stuck on.

FORUM assistance.xaml (15.7 KB)

** I have removed the scrape div as it had an image that had confidential data in the view **

Thank you for any assistance

Hi @LB34,
I’m not sure if I got this right but you are trying to get item with the first index (which is 0) event when the string is null. In other words you automation is trying to check what is inside the empty regex. This provides the issue here. You can try to use try-catch and set null or 0 value for you variable in case of error. Or you can use condition like “if variable is null/empty” then blablabla… Hope it makes sense.