How to make it so that if my variable contains any value from a datatable it performs a specific action

Hello all,
I am extracting the current date using
and using the month to compare with a data table which is as follows:
Now what I intend is if the month is present in the data table then it should add 6 months to that date else it should subtract 6 months

I have some log messages along the way to guide me and it tells me that it finds a value that contains, never the less it is subtracting when it should be adding, any idea why?
Output window:


It’s because you evaluate “06” in the final row and it subtract 6 from currentMonth.
I think it’s easier to use FilterDataTable as the following, if my understanding is correct.


Hii @goncalo.rocha ,

You can do this using below code

  1. If the currentMonth is present

  2. If the currentMonth is not present

You can refer the attach workflow for your reference. (2.2 KB)


Hey @goncalo.rocha

Just in the if contion use
MonthFinanceVariable = now.AddMonths(+6).ToString(“MM/yyyy”)
in the else condition use
MonthFinanceVariable = now.AddMonths(-6).ToString(“MM/yyyy”)
Rest is fine in your code
I think this will help


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