0

I have a flow that's set to run once a day. It queries a SharePoint list and collates all list items with a specific date field value that falls within the last 24 hours (via filter query). If no list items have a date value within the 24 hour window, the flow stops. If there are valid values, a CSV file is then generated and emailed to people.

Flow

When testing this flow, it works perfectly. It correctly collates data from the SP List, converts it to a CSV and emails it. However, whenever the flow runs automatically via the scheduled Recurrence, it always fails the filter query to recognise any list items with valid date values. The source data definitely has valid dates almost every business day.

Recurrence

Get items

Filter query: DateOnboarded ge '@{addDays(utcnow(),-1)}'

Condition

Condition: @{length(outputs('Get_items')?['body/value'])} is greater than 0

3
  • Can you share the detail of the error?
    – jleture
    Commented May 20 at 6:37
  • @jleture there is no error as such, it just doesn't recognise any valid data in the "Get Items" step Commented May 21 at 2:01
  • If you want to be able to debug this just place Compose action in front of "Get Items" called eg. "Compose - Filter Query" place there your filter "'@{addDays(utcnow(),-1)}'" and then in the 'Filter Query' field refer just to the compose. -it shall throw error with compose || Or just try to recreate the flow from blank new one (not any template)
    – Popkornak
    Commented May 23 at 11:26

1 Answer 1

0

Figured it out. Due to us entering only dates into the SP List DateTime field, all the DateTime data had a time of 00:00:00 UTC. Because our local timezone is UTC+10, this was causing all of our DateTime data to fall outside the 24 hour window at the scheduled time of 2:00 am, but not outside of 24 hours if we ran the flow manually during the daytime.

Setting the Filter Query to DateOnboarded ge '@{addDays(utcnow(),-2)}' has resolved the issue for us.

Thanks to @Popkornak for the debugging suggestion, this helped me realise the timezones weren't matching up.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.