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 / Using outputs from SQL...
Power Automate
Unanswered

Using outputs from SQL procedure

(0) ShareShare
ReportReport
Posted on by 19

Hi Team,

 

I'm attempting to use a flow which returns an SQL stored procedure, and then use the values to create entries into a shared calendar in Outlook. 

 

However, I'm not having much luck with getting the Email & Date value extracted from the return (example below)

 

I had a look at the string conversion options, and trying to use substring to gather the required values with indexValues however it seemed very messy and I'm sure there is a better way to convert/filter (to an array perhaps?) so that I can easily extract the email and date, particularly when there will be multiple rows returned.

 

Any suggestions appreciated

{
 "ResultSets": {
 "Table1": [
 {
 "EMail": "email@domain.com.au",
 "TransDate": "2020-02-20T00:00:00"
 }
 ]
 },
 "OutputParameters": {}
}

 

Categories:
I have the same question (1)
  • Verified answer
    abm abm Profile Picture
    32,865 Most Valuable Professional on at

    Hi @SamTimmins 

     

    Follow the below steps:

    image.png

     

    Next use a Parse JSON to extract the values

    image.png

    The above schema I used is as follows: (Copy & Paste the same schema in your flow action step)

     

    {
    "type": "object",
    "properties": {
    "ResultSets": {
    "type": "object",
    "properties": {
    "Table1": {
    "type": "array",
    "items": {
    "type": "object",
    "properties": {
    "EMail": {
    "type": "string"
    },
    "TransDate": {
    "type": "string"
    }
    },
    "required": [
    "EMail",
    "TransDate"
    ]
    }
    }
    }
    },
    "OutputParameters": {
    "type": "object",
    "properties": {}
    }
    }
    }
     
    Next we need to iterate the JSON object to extract the values
    image.png
     
    Here are my test results:
    image.png
  • ChristianAbata Profile Picture
    8,951 Most Valuable Professional on at

    hi @SamTimmins  you can parse your asnwer with parse json.

    Frist in content you need to pass your output, then clic on generate from sample an paste the answer that you paste here and then just done, you are going to be able to use every part of your response.

    json.png

  • PAUser70 Profile Picture
    10 on at

    HI,

     

    I have the same issue trying to extract values from the store procedure's output body. I followed all the steps to create compose and Parse JSON but I am getting an error 

     

    ExpressionEvaluationFailed. The execution of template action 'Apply_to_each' failed: the result of the evaluation of 'foreach' expression '@body('Parse_JSON')?['ResultSets']?['Table1']' is of type 'Null'. The result must be a valid array.JSON error.png

     

     
  • PAUser70 Profile Picture
    10 on at

    JSON Setup error.png

  • abm abm Profile Picture
    32,865 Most Valuable Professional on at

    Hi @PAUser70 

     

    Could you please post a sample JSON data where I can copy and paste in my test flow.

     

    Thanks

     

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

#2
Tomac Profile Picture

Tomac 405 Moderator

#3
abm abm Profile Picture

abm abm 252 Most Valuable Professional

Last 30 days Overall leaderboard