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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Trying to create a dea...
Power Automate
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.

Categories:
I have the same question (0)
  • PowerAppsWizard Profile Picture
    388 on at

    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?

  • Logannm Profile Picture
    8 on at

    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
    388 on at

    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
    8 on at

    It won't let me use the formatDateTime function

  • PowerAppsWizard Profile Picture
    388 on at

    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
    8 on at

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

    formatDateTime in the map for due date
  • Logannm Profile Picture
    8 on at

    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'.

  • PowerAppsWizard Profile Picture
    388 on at

    Hi

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

    It is some missing the tomorrow date as it complaints.

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 463 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 427 Moderator

#3
abm abm Profile Picture

abm abm 245 Most Valuable Professional

Last 30 days Overall leaderboard