I have a .csv document that I am going to store in a datatable. One of the columns is a list of dates (as shown in the image below). I want to check if the list has a different date from the one I am working with. For example, in the image shown I am working with the date “2024-09-06”, but the last record on the list is “2024-09-10”. I want to capture this verification as a Boolean variable.
I did a for each row in datatable and used an assign with the following query:
booleanVariable = “Get Row Item value output variable”.ToString.Contains(“my string variable”)
It works for each record, but I want to check the list as a whole, not iterating through each row.
As it will be in data table format, you need to iterate. But still, you can attempt as below also
Else you can and create a List from this date column and then check using if list contains…
Thanks,
Jagravi
You can try this linq query
booleanVariable = YourDT.AsEnumerable.Any(Function(row) not row(“DateColumn”).ToString.Equals(“my string variable”))
It will return True if any value in Date column is different from what you are looking for and will return false if all values are same.
Never mind. The issue was the “Equals” part of the query as what I was looking for was not always the same. I changed it to “Contains” and it worked like a charm. THANKS!