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 / Write email after Exec...
Power Automate
Unanswered

Write email after Executing a SQL query (via on-prem Gateway) for Recurring flow

(1) ShareShare
ReportReport
Posted on by

Good day

 

I have a recurring flow that tests every day whether it is the beginning of the month.  If so, it extracts data from a SQL Stored Procedure to see which contracts are in "Follow Up" status.  It then must send an email to the Procurement officer to warn him that this contract is coming up for renewal.  Everything works fine up to the point that I run the SQL stored procedure.  I need to get the data from the stored procedure and use that to send emails.  However, I am stuck.  Can you please help me to complete the flow, starting after the "Executing the SQL query"?

 

Thanks

 

 

janineb_1-1719917585017.png

 

 

Categories:
I have the same question (0)
  • Michael E. Gernaey Profile Picture
    53,288 Super User 2025 Season 2 on at

    Hi @janineb 

     

    What is wrong with what you have?

  • janineb Profile Picture
    on at

    Hi

     

    Thank you for your response.  This is the error I'm getting

     

     

    janineb_0-1720103741113.png

     

  • Michael E. Gernaey Profile Picture
    53,288 Super User 2025 Season 2 on at

    Thanks @janineb 

     

    In the future remember to include the things necessary to debug, it saves those helping you a lot of time and gets you resolved faster.

     

    So the issue is you picked the output of the Compose, which is an Object, what we need to do is convert that to an Array.

     

    Can you please explain do the following

    1. Share the Output of the Compose here, that way I can see the format.

    2. Tell me exactly what data you want out of the Compose so that I can find the proper Path of data to convert what you are giving it from an Object to an Array

     

    Thanks


    If I have helped you, I would really appreciate if you please Mark my answer as Resolved/Answered, and give it a thumbs up, so it can help others

    Cheers

    Thank You
    Michael Gernaey MCT | MCSE | MCP | Self-Contractor| Ex-Microsoft
    https://gernaeysoftware.com
    LinkedIn: https://www.linkedin.com/in/michaelgernaey

  • janineb Profile Picture
    on at

    Thank you so much Michael, it worked perfectly.   I appreciate your guidance on providing all the info.

     

    I changed the Condition (Apply to each) to:  array(triggerOutputs()?['body'])

    This was my Output:

    janineb_0-1720350724892.png

    The last thing I would like assistance with is the Email please:

     

    janineb_2-1720351002735.png

    How can I populate the fields next to each "Heading" with the information in the database (Output example above - blue text).  This is the only options available under the Dynamic content.

     

    janineb_3-1720351145753.png

     

    Much appreciated

  • janineb Profile Picture
    on at

    This is the current output from the email

    {
    "statusCode": 200,
    "headers": {
    "Cache-Control": "no-store, no-cache",
    "Pragma": "no-cache",
    "Set-Cookie": "ARRAffinity=f2b03ea959f8416bc6b71d28a36cf8c0479d848b33638ccc3ef4c51389285d81;Path=/;HttpOnly;Secure;Domain=office365-we.azconn-we-002.p.azurewebsites.net,ARRAffinitySameSite=f2b03ea959f8416bc6b71d28a36cf8c0479d848b33638ccc3ef4c51389285d81;Path=/;HttpOnly;SameSite=None;Secure;Domain=office365-we.azconn-we-002.p.azurewebsites.net",
    "Strict-Transport-Security": "max-age=31536000; includeSubDomains",
    "x-ms-request-id": "76b78438-e40a-7fdc-4f21-d8c64955d20f",
    "X-Content-Type-Options": "nosniff",
    "X-Frame-Options": "DENY",
    "x-ms-environment-id": "default-b4e5483d-e090-4a58-b1cf-fbaa0ec4beb5",
    "Timing-Allow-Origin": "*",
    "x-ms-apihub-cached-response": "false",
    "x-ms-apihub-obo": "false",
    "Date": "Sun, 07 Jul 2024 11:35:13 GMT",
    "Content-Length": "0",
    "Expires": "-1"
    }
    }

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 523 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 406 Moderator

#3
abm abm Profile Picture

abm abm 245 Most Valuable Professional

Last 30 days Overall leaderboard