web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Get items in sheduled ...
Power Automate
Answered

Get items in sheduled flow

(0) ShareShare
ReportReport
Posted on by

Hi Everyone 

 

I need to Create a scheduled flow that runs weekly.

The flow should retrieve items from a SharePoint list and identify the dates in the "Next Action Date" column.

One week after the "Next Action Date," the flow should send an email to the requester listed in the SharePoint list.

 

Danny_Dicaprio_0-1711953200057.png

 

 

Could anyone please help to fix the flow 

I got stuck with adding condition to the flow

 

@items('Apply_to_each')?['Next_action_date'],addDays(utcNow(), 7))
 
the condition which Iam trying to check is if the next actiondate +7 = true    I will send a email to the requestor corresponding to the email ID column from the Next action date 
 
Categories:
I have the same question (0)
  • v-yetonggu-msft Profile Picture
    Microsoft Employee on at

    Hi @Danny_Dicaprio ï¼Œ

    If I understand correctly, do you want to send the email when Next action Date+7 is equal to today's date?

    If so, please check this test:

    vyetonggumsft_1-1711954511380.png

     

    addDays(items('Apply_to_each')?['Next_action_date'],7,'yyyy-MM-dd')
    utcNow('yyyy-MM-dd')
    

     

    Best Regards,

    Sunshine Gu

  • Danny_Dicaprio Profile Picture
    on at

    Hi @v-yetonggu-msft 

     

    Thanks for the reply its showing an error where the expression in invalid 

     

    addDays(items('Apply_to_each')?['Next_action_date'],7,'yyyy-MM-dd')utcNow('yyyy-MM-dd')
    Danny_Dicaprio_0-1711956189257.png

     

  • v-yetonggu-msft Profile Picture
    Microsoft Employee on at

    Hi @Danny_Dicaprio ,

    Please look carefully at my flow screenshot.

    What I gave you are two expressions.

    You need to fill in the left and right sides of the condition respectively.

    condition left:

    addDays(items('Apply_to_each')?['Next_action_date'],7,'yyyy-MM-dd')

    condition right:

    utcNow('yyyy-MM-dd')

    Use is equals to in the condition.

    vyetonggumsft_0-1711956826614.png

    Best Regards,

    Sunshine Gu

  • Danny_Dicaprio Profile Picture
    on at

    Hi @v-yetonggu-msft 

     

    I am really sorry , still Iam facing an error 

    Danny_Dicaprio_0-1711957781538.png

     

    Unable to process template language expressions for action 'Condition' at line '0' and column '0': 'The template language function 'addDays' expects its first parameter to be a string that contains the time. The provided value is of type 'Null'.

     

    could u please help me to fix this error 

  • v-yetonggu-msft Profile Picture
    Microsoft Employee on at

    Hi @Danny_Dicaprio ,

    Your ‘Next_action_date’ column has a null value, so flow will report an error that first parameter of addDays function is Null.

    Please try to put this expression on the left side of condition, and the expression on the right side remains unchanged.

    if(empty(items('Apply_to_each')?['Next_action_date']),null,addDays(items('Apply_to_each')?['Next_action_date'],7,'yyyy-MM-dd'))

     Best Regards,

    Sunshine Gu

  • Danny_Dicaprio Profile Picture
    on at

    HI @v-yetonggu-msft 

     

    Sorry for the delayed response '

     

    The condition is working fine , but the flow is not working properly 

     

    I have set the next actions date as 2024-03-25 in my sharepoint list 

     

     the flow is as triggered for every minute 

     

    for the condition to match 2024-03-25 +7  = 2024-04-01

     

    I have around 128 records in my SP list but the seems like number of iterations for apply to each is comming only upto 100

     

    Danny_Dicaprio_2-1711966506775.png

     

    Do know how we can fix it  ?

  • Verified answer
    v-yetonggu-msft Profile Picture
    Microsoft Employee on at

    Hi @Danny_Dicaprio ,

    Is your requester column a people column?

    I did another test for your reference.

    This involves the limitation of condition.

    I suggest you use Filter array to filter out 'Next_action_date+7' which is equal to today's date, then apply to each the item in Filter array and send emails to requesters who meet the conditions.

    My SharePoint List:

    vyetonggumsft_3-1711970608408.png

    My Flow:

    vyetonggumsft_0-1711969979290.png

    vyetonggumsft_2-1711970479095.png

     

    if(empty(item()?['Next_action_date']),null,addDays(item()?['Next_action_date'],7,'yyyy-MM-dd'))
    utcNow('yyyy-MM-dd')
    items('Apply_to_each')?['Requestor/Email']

     

    Best Regards,

    Sunshine Gu

  • srduval Profile Picture
    1,796 Moderator on at

    Go into the setting of the sharepoint get items and enable pagination. Set it to the maximum your license allows. enter 10000000000 and it will tell you what your limit is.

  • Danny_Dicaprio Profile Picture
    on at

    Hi @v-yetonggu-msft @srduval 

    Thanks'

    I made all the changes Its working fine, one last issue Iam facing is if I want contents (other sharepoint column details like subject , ID )  inside the mail body for each record how do Ido it. 

     

    I tried the following way  

    Danny_Dicaprio_0-1712034244999.png

     

     

    But Iam getting this error "Flow save failed with code 'InvalidTemplate' and message 'The template validation failed: 'The repetition action(s) 'Apply_to_each_2' referenced by 'inputs' in action 'Send_an_email_(V2)' are not defined in the template.'.'."

  • Verified answer
    v-yetonggu-msft Profile Picture
    Microsoft Employee on at

    Hi @Danny_Dicaprio ,

    Please check your expression in Send an email(V2).

    Make sure you refer to Apply_to_each in your expression and not Apply_to_each_2.

    -------------------------------------------------------------------------------------------------------------------------------

    If I solve your problem, please mark my response as a solution so I can help more people who are experiencing this challenge in the future.

     

    Best Regards,

    Sunshine Gu

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Valantis Profile Picture

Valantis 474

#2
11manish Profile Picture

11manish 268

#3
David_MA Profile Picture

David_MA 243 Super User 2026 Season 1

Last 30 days Overall leaderboard