I have a MS List with items constantly being added (a manufacturing dept. where we have a near 24-hour work cycle where items are being created at all hours of the day). At the start of the morning shift at 6am I have Power Automate sending out an email with 2 tables for open items, one for items more than 1 day old and one for items made within the last 24 hours.
My “older than 1 day” filter array pulls items correctly. However, my “the last 24 hours” is only pulling the oldest ones that are close to 24 hours old but is ignoring everything more recent.
The 24-hour cycle I think is the difficulty here due to possibly time zones or date formats that "flatten" time like in the startOfDay function.
The below formula is only pulling the highlighted few items in the attached image (ran the flow around 6-7am). (note on the list: My list has formulas in the Created column color-coding the age of the item, green for <24 hours, yellow for 24-48 hours).
@And(lessOrEquals(ticks(startOfDay(body('Current_time'))), ticks(addDays(startOfDay(item()?['Created'], 'yyyy-MM-ddTHH:mm:ssZ'), 1))),equals(item()?['Status']?['Value'], 'To Do'))
My "older than 1 day" formula in case it adds some context, but this one seems to work perfectly.
@And(greaterOrEquals(ticks(startOfDay(body('Current_time'))), ticks(addDays(startOfDay(item()?['Created'], 'yyyy-MM-ddTHH:mm:ssZ'), 1))),equals(item()?['Status']?['Value'], 'To Do'))