Getting an error in Matches

Hi, I am getting below error in Matches

How to fix this

@Puneet_Singh1 - Its not an error. Data is coming Matches activity which is IEnumerable variable.

So in the message box …please give Data(0).value or Data(0).tostring…

Hi @Puneet_Singh1

if the data contains a list of values and then u can convert it to a array the loop through every element to get the value

use the below code

data_list=Data.Cast(Of Match).Select(Function(m) m.Value.ToString).ToArray()

Now loop through each element in data_list and then get the value one by one

Regards,
Nived N
Happy Automation

It showing error to me. My I enumerable data store in Data variable

Instead of Of Data use Of Match,

I think you had written the code wrong

Sorry for bothering still having same issue

Can u check the datatype of Data_list,

it should be String

@Puneet_Singh1 - if you could share the input text and the output required, we can help you in getting that written to datatable…

Actually without looping, Matches can be added to datatable using the below query(Below is for Single Column)

Dt = (from m in YourRegexVar.Cast(of Match)
Select dt.Rows.Add(m.toString)).CopyToDataTable
1 Like

@prasath17 , it should be m.Value.ToString instead of m.ToString :blush:

In this Barcode is string and data is IEnumerable

Hi @NIVED_NAMBIAR – Actually m.value should be good. Please see the example below…

1 Like

Thanks for help i think i am doing something wrong actually i am not older in UiPath

one more question below is the screenshot
image

In if condition I am having some value in HOUSING variable which is exactly macthing with one of the data in Data_List table but still its going in else part.

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