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 / Error -- 'Apply_to_eac...
Power Automate
Answered

Error -- 'Apply_to_each' / Power BI

(0) ShareShare
ReportReport
Posted on by 8

Hi,

Brand new to Power Automate.  I'm trying to use a connection in Power BI to send out an email when the button is pushed on my dashboard. 

The flow is connected a visual with a list of emails and once up and running, should send an email to each person on the list.  

 

I'm getting the following error:


The execution of template action 'Apply_to_each' failed: the result of the evaluation of 'foreach' expression '@triggerBody()?['entity']?['Power BI values']' is of type 'Null'. The result must be a valid array.

 

Within the email body is dynamic information from the PowerBI visual - like name, number, etc.  There are no null values in my data, so I'm not sure where the 'Null' above is coming from. 


Any help would be greatly appreciated!

 

LizAdams_0-1626973674236.png

 

Categories:
I have the same question (0)
  • Verified answer
    DamoBird365 Profile Picture
    8,942 Microsoft Employee on at

    Hi @LizAdams 

     

    The null is referring to the "output from previous step" in the apply to each.  Did you create the apply to each or did Flow?  I would stick a compose into your flow above the apply to each and insert the "Power BI Data" dynamic value.  Then run the flow and look back at the history to see what data you are playing with.  

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
    Cheers,
    Damien


    P.S. take a look at my new blog here and like & subscribe to my YouTube Channel thanks 😉

  • LizAdams Profile Picture
    8 on at

    Hi @DamoBird365,

    THANK YOU!!

    Flow added the apply to each automatically.  Adding the compose above worked!  

    If it's not too big of an explanation - could you share what that action is doing?  Is it making the PowerBI data a query-able table?  

  • DamoBird365 Profile Picture
    8,942 Microsoft Employee on at

    Hi @LizAdams 

     

    Glad you appear sorted, however the compose shouldn't resolve the issue.  It was more a way to demonstrate the data being retrieved by that dynamic value and I was hoping it would highlight to you why the apply to each was failing.  The apply to each will always expect an array ["valueorobject1","valueorobject2","valueorobject3"] etc.

     

    If you choose a dynamic value in an action (send email for instance) and it is part of an array, powerautomate will insert an apply to each as it will assume that there are multiple objects and will therefore need to loop through them all.  If you know the array will only contain one object, you can reference it by using the first() expression.

     

    I explain some of these concepts in the following video https://youtu.be/6nJSUNh579w

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
    Cheers,
    Damien


    P.S. take a look at my new blog here and like & subscribe to my YouTube Channel thanks 😉

     

  • LizAdams Profile Picture
    8 on at

    @DamoBird365 - thank you, I'll check out your video!  I appreciate your help 😀

  • marisanlee Profile Picture
    2 on at

    I am having a similar issue but I am not given the option to select "Power BI Data" through the Dynamic Content.

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…

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Automate

#1
trice602 Profile Picture

trice602 398 Super User 2025 Season 2

#2
David_MA Profile Picture

David_MA 323 Super User 2025 Season 2

#3
Expiscornovus Profile Picture

Expiscornovus 183 Most Valuable Professional

Last 30 days Overall leaderboard