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

Community site session details

Session Id :
Power Automate - Building Flows
Answered

Powerautomating a flow to send email reminders - Apply to each failing

(0) ShareShare
ReportReport
Posted on by 16

Hi, 

 

I was hoping i could get some support in running into an issue. I keep testing the flow and recieve this message:

 

The execution of template action 'Apply_to_each' failed: the result of the evaluation of 'foreach' expression '@variables('varDate7DaysOut')' is of type 'String'. The result must be a valid array.

 

I have no idea what to do. I have tried to search around.

 

Many thanks in advance

I have the same question (0)
  • Andrew_J Profile Picture
    1,962 Moderator on at
    Re: Powerautomating a flow to send email reminders - Apply to each failing

    @Akash23

     

    This seems to me like a adddays function, you need to look at UTC and then adddays but use a -7, If that helps then great.  But if you need anything more then I will look at later on today.

     

    Regards

     

    Andrew

  • Akash23 Profile Picture
    16 on at
    Re: Powerautomating a flow to send email reminders - Apply to each failing

    Hi Andrew,

     

    Thank you. I tried a couple of other methods and seem to be getting issues every time. I have attached the steps i have taken and can't seem to see where i am making the mistake.

     

    Thanks,

     

    Akash

  • Andrew_J Profile Picture
    1,962 Moderator on at
    Re: Powerautomating a flow to send email reminders - Apply to each failing

    I am confused at the trigger for the flow and as I am on my mobile it is not easy to see the original image. 

  • Akash23 Profile Picture
    16 on at
    Re: Powerautomating a flow to send email reminders - Apply to each failing

    The triggers are so i can 7 days prior to project task due date send a reminder to the assigned person that there task is due for completion in 7 days.

     

    I have set up the furst couple of lines to feed back the date and milestones that fall within the parameters. I have checked those actions and all tick off except when i try and automate the email part of the flow.

     

    Does that make sense? 

  • Andrew_J Profile Picture
    1,962 Moderator on at
    Re: Powerautomating a flow to send email reminders - Apply to each failing

    @Akash23 

     

    I have been looking at this, whilst there is always many ways to doing things in flow, you may need need to look at this differently.  The apply to each is looking for a variable so try something like the below which does the same.  This is flow I created to pull a list of items every month and then issue the tasks to a group of people:

     

    Andrew_J_0-1675380243390.png

     

    Let me know if the above helps, I am a learner myself so I can only apologise for not knowing it all.

     

    Regards,

     

    Andrew

     

  • Akash23 Profile Picture
    16 on at
    Re: Powerautomating a flow to send email reminders - Apply to each failing

    Hi Andrew,

     

    Thank you for all the support. I have managed to figure it out in a random way but it works.

     

    When i apply to each to give me the 'value' and then apply to each again with 'Assigned to' as the output it seems to work and send everyone assigned to the task a email 7 days out. 

     

    I landed on it randomly and it works to what i require it to at the moment

     

    Again, thank you so much for your help and support

  • Verified answer
    Akash23 Profile Picture
    16 on at
    Re: Powerautomating a flow to send email reminders - Apply to each failing

    Hi Andrew,

     

    Thank you for all the support. I have managed to figure it out in a random way but it works.

     

    When i apply to each to give me the 'value' and then apply to each again with 'Assigned to' as the output it seems to work and send everyone assigned to the task a email 7 days out. 

     

    I landed on it randomly and it works to what i require it to at the moment

     

    Again, thank you so much for your help and support

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Chiara Carbone – Community Spotlight

We are honored to recognize Chiara Carbone as our Community Spotlight for November…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 666 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 382 Moderator

#3
developerAJ Profile Picture

developerAJ 254

Last 30 days Overall leaderboard