Working out date period

Hi all

Part of my process includes clicking on this screen and, depending on what the date falls between, clicking on the relevant “Tax Period” number.


Any ideas on how to do this?

I thought a Switch was the best activity to use but I don’t know what to use for the Expression. I figured something like now.ToString(“dd/MM”) >= 06/04 and 05/05 <= but get an error stating “Complier error(s) encounted processing expression “now.ToString(“dd/MM”) >= 06/04 abd 05/05 <=”. Expression expected”. I have the TypeArgument set to String


I believe switch is not so good for your use case. A nested flow decision can be much better, the condition expression is DateTime.Now >= Convert.ToDateTime(“06/04” & “/” & Now.ToString(“yyyy”)) OR DateTime.Now <= Convert.ToDateTime(“05/05” & “/” & Now.ToString(“yyyy”))
True part = click on Tax period 1
False part goes to another flow decision with the condition as the next date range and so on…

Please note that this is in assumption that your machine already uses date format as dd/MM/yyyy otherwise you have to tweak this a bit

@Short In Case you are unable to get the dynamic selector then use switch logic to click based upon the Expression output otherwise just use click activity with dynamic selector using taxPeriod
Please find attached sequence
Sequence19.xaml (5.3 KB)

1 Like

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