Assign new value IEnumerable


I am using Regex to capture a value from an output, the output may or may not have ‘self’ in it.
When it does contain ‘self’ there are no issues however when there is no ‘self’ the output is empty.
When writing that value into a datatable I get the errorobject

To solve this I am looking to have an IF statement
Then… continue
Log Message (all working)

The assign part is where I would like to assign a value to the MyVariable so there is a value instead of being empty.
I changed the MyVariable.ToString = but I am not sure how to assign a value it.
Or I was wondering if I could reassign the original regex IEnumerable variable to another IEnumberable value.

Thank you for any guidance

Hi @LB34

If the output from regex matches is empty

Can u validate it with the below condition in if statement

Let’s say MyVariable is the output from the regex activity

Then use

MyVariable.Count<>0 as condition
It means MyVariable.Count is not equal to zero. Then put if and else condition Accordingly.

Hope it helps you


Nived N :robot:.
Happy Automation :relaxed::relaxed::relaxed::relaxed:

Hi Nived,

Thanks for that, apologies as I may not have explained it well.
The condition I have is working, its the ‘else part’ I would like to assign a new variable to that empty field.

The variable contactMatch is an IEnumerable. I was trying to assign an alternate value so it wasnt empty


Is the contactmatch which u are Assigning as a value is also a IENUMERBALE?

The contactMatch on the right is the original value.

contactMatch = empty
I want to assign a new value instead of empty to ‘0’ or ‘NULL’