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 / Emailing based on resu...
Power Automate
Answered

Emailing based on results of querying power bi dataset

(3) ShareShare
ReportReport
Posted on by 50
I have a Power Bi dataset that looks like this:  (dashboard filtered to me for PHI sake)
 
What I want to do is build a power automate flow that queries this dataset every day.  When a row has a "Days to Expiration" less than 60, I want it to trigger an email.
 
The email would go to the person listed, and cc their "Prim Reg Assistant".  The email addresses are in the dataset (just not shown on dashboard).  They are "EMAIL_ADDRESS" and "Prim Reg Email".
 
I asked an AI how to do this and it pretty much gave me the roadmap (listed below), but I am having trouble with one particular case.

General Plan:

Step 1: Trigger the Flow

  • Trigger: Use the "Recurrence" trigger to schedule the flow. This will allow it to run periodically (e.g., daily, weekly).

Step 2: Run Power BI Query

  • Action: Use the "Run a query against a dataset" action for Power BI. Set the dataset to "REG-Credential Management."
    • Query the table "rv_contact_credential_with_primreg" using DAX or SQL, and filter rows where "Days to Expiration" is less than 60.

Step 3: Parse Query Results

  • Action: After running the query, you’ll get a list of records. Use the "Apply to each" action to iterate through the results.
    • Extract relevant columns: "EMAIL_ADDRESS," "Primary Reg Email," and "Days to Expiration."

Step 4: Send Emails

  • Action: Use the "Send an email (V2)" action.
    • To: Set to the value from "EMAIL_ADDRESS."
    • CC: Set to the value from "Primary Reg Email."
    • Subject: Customize the subject, e.g., "Credential Expiration Warning."
    • Body: Add a message like, "Your credential is about to expire in [Days to Expiration] days."
       
 

Here's where I'm having a problem:

   I've done this so far and tested it, and it appears to work.  Queries the dataset, returns all the rows that fit the criteria:


But I have no idea how to do the "Apply to each" step.



I've added it, but how do I add stuff inside it?  What action do I use?  I even asked the AI to spell out the details and it did:


But again, how do I actually DO that?  Do I hit the plus sign and add an action?  I'm in the "new designer" if that matters.  Any help would be appreciated!

 

Categories:
I have the same question (0)
  • Suggested answer
    Michael E. Gernaey Profile Picture
    53,969 Moderator on at
    Hi
     
    That is correct, you will click the + inside the Apply to each. That way it will send an email for everyone loop iteration
     
    Now, depending on what the data is, you should see the Properties show up in the Dynamic Properties window for the items that were provided in the apply to each Inputs
     
    So if you did a Get Items for example and immediately, try to use EmailAddress into a Compose, it would immediately generate an Apply to each for you, put the Input in and t hen put the compose in there, where NOW it recognizes Emailaddress as a property/column/field for the current LOOP iteration and NOT the Table it would be otherwise.
     
    If this helps please make as the answer
     

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 589

#2
Valantis Profile Picture

Valantis 328

#3
David_MA Profile Picture

David_MA 284 Super User 2026 Season 1

Last 30 days Overall leaderboard