I am creating a flow that has a recurrence of running 3 times at day: 9am, 12pm & 3pm. Get items from a sharepoint list. And then have a Select to choose the fields. Will set up an email as well but i want to specify that it should only display new items between these times (if that makes sense?)
e.g. 9am email will display new items added from 3pm previous day to 8.59am that morning,
12pm email will display new items added from 9am to 11.59am that morning
3pm email will display new items added from 12pm-2.59pm that afternoon.
I think this will be a filter array but not sure how to set this up and need help.
Please take the following flow for a reference and try it on your side to see if it will work for you.
For testing, I am using the Button trigger, please change it to Recurrence on your side.
As the flow will be triggered at specific hours, to get items which were created within the specific time span, we need to use a Condition to check if current time equals to the specific time.
I initialized two variables for 9:00 and 12:00, value set as T09:00:00 and T12:00:00, you may try with another one,15:00.
Then Compose and Compose2 using the following code:
Set the two variables with the output of the Compose action.
Timestamp: Compose Output
Timestamp2: Compose2 Output
Then the first Condition to check if utcnow equals to variable timestamp.
If yes, get rows, using the following code in the filter query:
Created ge ‘addHours(utcnow(),-8)’ and Created lt ‘timestamp’
Under If no branch, add Condition2 to for timestamp2, then get items using the following code:
Created ge ‘addHours(utcnow(),-3)’ and Created lt ‘timestamp2’
All the steps are same for time 15:00, please try with it.
Images for your reference:
thanks for the reply @v-yamao-msft
I followed your instructions, unfortunately at 12pm i never got an email. There should have been an email with 3 items on it. I have probably done something wrong but wondered if are able to advise?
The 1st compose -
The 2nd Compose -
I ran the test and performed the trigger action, it said it was successful but claimed the Condition 2 the expression result was false and followed the No path.
I also tried another test, where is changed condition 2 to 'not greater than' and it failed. i got the following message:
@v-yamao-msft I have changed how i want this to run, and only want it to run once a day at the minute. Thought this would be a simpler procedure but unfortunately something hasn't gone right.
I had items which were added to the sharepoint list yesterday which should have followed the no route of the condition and emailed the list, instead it followed the yes route and sent the dummy email i had set up. Can you have a look at the flow and advise where i may have gone wrong please?
Followed similar procedure you outlined:
thanks in advance