cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
neill_long
Level: Powered On

Recurring 3 times daily, get items from SP List, results should display new items added

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.

 

Picture1.png

3 REPLIES 3
Community Support Team
Community Support Team

Re: Recurring 3 times daily, get items from SP List, results should display new items added

Hi @neill_long,

 

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:

concat(utcNow('yyyy-MM-dd'),variables('timestamp'))
concat(utcnow('yyyy-MM-dd'),variables('timestapm2'))

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:

 1.PNG2.PNG

 

Best regards,

Mabel Mao

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
neill_long
Level: Powered On

Re: Recurring 3 times daily, get items from SP List, results should display new items added

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?

 

Pic1.pngPic2.png

 

The 1st compose -

concat(utcNow('yyyy-MM-dd'),variables('timestamp'))

The 2nd Compose -

concat(utcnow('yyyy-MM-dd'),variables('timestamp2'))

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:

 

Pic3.png

Highlighted
neill_long
Level: Powered On

Re: Recurring 3 times daily, get items from SP List, results should display new items added

 

@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:

Picture1.png

Concat(utcNow('yyyy-MM-dd'),variables('timestamp'))

Picture3.png

 

addDays(utcNow(),-1)

thanks in advance

 

 

Alistair

>