I have a scheduled flow which I want to search multiple date fields in an Excel table each day to see if today is 3 days before the date in the fields, and if yes, to send me an email based on some other field conditions.
I've got as far as scheduling the flow and getting the items from the table (with ISO8601 formatting), but with regards to comparing the times, when this flow runs the condition returns a 'false' output, even though the date in the field is set to 3 days from today (today is 13/12/21 and the date in my table is 16/12/21):
Solved! Go to Solution.
Thank you so much @fchopo for your help but I think I managed to fix the issue with the same process as above but I simply started a fresh flow from scratch as I'd read that sometimes it won't work when you've been moving things around.
I'm going to try and add a few more comparisons in for my other date columns so will return if I get stuck!
Hi @jboyes1
At what time is your workflow running? utcNow() will return date and time in UTC, you might be in a different time zone, and that could be the reason the values are different.
Regards,
Ferran
It's UTC+00:00 - I'm testing the flow by manually running it though. It's also tricky as I can't see what the outputs are for the formulas to see what else might be going wrong.
You should be able to see how dates are coming from Excel. Are the Excel cells formatted as datetime values?
Here's where I'm at now - I'd had a play around and when I tried running the formulae through their own 'apply to each' command and they seemed to be returning themselves as outputs, so I've tried using Compose to create some outputs and am comparing those instead:
Compose shows the time of my Excel field:
OK!
Finally, let's try to convert those values to integer ones using the ticks function. Try to use the ticks function in both elements and compare the values again. It should work comparing numbers!
ticks(formatDateTime(item()?['Start date'], 'yyyy-MM-dd')) equals ticks(addDays(utcNow(),-3,'yyyy-MM-dd'))
Hope it helps!
Ferran
Thank you so much @fchopo for your help but I think I managed to fix the issue with the same process as above but I simply started a fresh flow from scratch as I'd read that sometimes it won't work when you've been moving things around.
I'm going to try and add a few more comparisons in for my other date columns so will return if I get stuck!
User | Count |
---|---|
93 | |
40 | |
23 | |
20 | |
16 |
User | Count |
---|---|
130 | |
49 | |
46 | |
30 | |
25 |