Skip to main content

Notifications

Power Automate - Using Connectors
Unanswered

Trying to create a deadline reminder

(0) ShareShare
ReportReport
Posted on by 8

I am trying to create a flow that sends me a teams message/email reminder if an item on my planner is due the next day. Every time I run it, it faills with "Action 'Apply_to_each_2' failed.  The execution of template action 'Apply_to_each_2' failed: the result of the evaluation of 'foreach' expression '@{outputs('List_tasks')?['body/value']}@{items('Apply_to_each_4')?['dueDateTime']}' is of type 'String'. The result must be a valid array." I know there was a template for this at one point but it appears to have been deleted.

  • PowerAppsWizard Profile Picture
    PowerAppsWizard 382 on at
    Re: Trying to create a deadline reminder

    Hi

    Please post details of your filter array and the tomorrow date compose action.

    It is some missing the tomorrow date as it complaints.

  • Logannm Profile Picture
    Logannm 8 on at
    Re: Trying to create a deadline reminder

    I was able to fix it (I think) but now I have an error in the flow checker for Filter array "Correct to include a valid reference to 'Compose_-_Tomorrow' for the input parameter(s) of action 'filter_array'.

  • Logannm Profile Picture
    Logannm 8 on at
    Re: Trying to create a deadline reminder

    Sorry for not being clear, it says "The expression is invalid."  when trying to enter 

    formatDateTime in the map for due date
  • PowerAppsWizard Profile Picture
    PowerAppsWizard 382 on at
    Re: Trying to create a deadline reminder

    Could you please be a bit more specific?

    In which step it doesn't allow you?

    What error message do you get?

    You are using the "Expression" tab (next to dynamic content) for entering the formatDateTime function, right?

  • Logannm Profile Picture
    Logannm 8 on at
    Re: Trying to create a deadline reminder

    It won't let me use the formatDateTime function

  • PowerAppsWizard Profile Picture
    PowerAppsWizard 382 on at
    Re: Trying to create a deadline reminder

    Hi @Logannm 

     

    I would do the following.

    1. List task action

    2. Compose action to create tomorrows date (with some good date formating)

     

    PowerAppsWizard_1-1646948612301.png

    formatDateTime(addDays(utcNow(),1),'dd/MM/yyyy')

    3. Filter the retrieved tasks to avoid task which has no due date and are equal to tomorrow date

    PowerAppsWizard_2-1646948802501.png

    Input: are the "value" of the list task action (dynamic content)

    Filter condition is in advanced mode with code

    @and(not(equals(item()?['dueDateTime'], null)),equals(formatDateTime(split(item()?['dueDateTime'],'T')[0],'dd/MM/yyyy'),outputs('Compose_-_Tomorrow')))

     

    4. Select action to create a nice array of certain value

    PowerAppsWizard_3-1646948962639.png

    Input:

    body('Filter_array_-_Task_Due_Date_not_equals_null')

    Map:

    Title
    item()?['title']
    Due Date
    formatDateTime(split(item()?['dueDateTime'],'T')[0],'dd/MM/yyyy')
    UserId
    item()?['_assignments']?[0]?['userId']
    TaskId
    item()?['id']

     

    5. Apply to each loop to run trhoug each task to send the email/teams channel

    PowerAppsWizard_4-1646949413456.png

    Get User Profile

    PowerAppsWizard_5-1646949550522.png

    Send email

    PowerAppsWizard_6-1646949753554.png

    That works very fine 🙂

     

    Final Email

    PowerAppsWizard_8-1646950051556.png

     

    Hope that brings it closer to what you want to achieve.

     

    Please accept as solution if it will solve your challenges.

     

     

  • Logannm Profile Picture
    Logannm 8 on at
    Re: Trying to create a deadline reminder

    Untitled2.png

    I can't fit the whole flow on screen but I believe what's in the screenshot is the problem.

     

  • PowerAppsWizard Profile Picture
    PowerAppsWizard 382 on at
    Re: Trying to create a deadline reminder

    Hi

    I think the part of your query has not a correct reference {outputs('List_tasks')?['body/value']}@{items('Apply_to_each_4')?['dueDateTime']}. ..

    Can you share the flow details?

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

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,422

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,711

Leaderboard

Featured topics