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 / Run a query against a ...
Power Automate
Unanswered

Run a query against a Power BI dataset and insert in to SQL Database

(0) ShareShare
ReportReport
Posted on by

Hi All

I am trying to fetch the field names to insert into my Azure SQL database but cannot get to that stage. All I get is the output and not the names of the fields I require.

Please see the image for my flow.

 

Thanks in advance.

Categories:
I have the same question (0)
  • ManishSolanki Profile Picture
    15,091 Super User 2025 Season 2 on at

    Hi @therush321 

     

    Pls share the screenshot of the previous flow run, I want to see the result from each action especially output of "Run query against a dataset" and "Select" actions.

     

    Thanks

  • therush321 Profile Picture
    on at

    @ManishSolanki 
    The out of the Run a query against a dataset:

    {
     "statusCode": 200,
     "headers": {
     "Pragma": "no-cache",
     "Transfer-Encoding": "chunked",
     "Strict-Transport-Security": "max-age=31536000; includeSubDomains",
     "X-Frame-Options": "deny",
     "X-Content-Type-Options": "nosniff",
     "RequestId": "2785bd69-4133-9c35-6f519dff77de",
     "Access-Control-Expose-Headers": "RequestId",
     "Timing-Allow-Origin": "*",
     "x-ms-apihub-cached-response": "false",
     "x-ms-apihub-obo": "false",
     "Cache-Control": "no-store, must-revalidate, no-cache",
     "Date": "Wed, 16 Aug 2023 13:33:17 GMT",
     "Content-Type": "application/json",
     "Content-Length": "246742"
     },
     "body": {
     "results": [
     {
     "tables": [
     {
     "rows": [
     {
     "[IsGrandTotalRowTotal]": true,
     "[SumBillable_Hours]": 78840331.3858350001,
     "[SumTotal_Hours]": 9407717.5886129998,
     "[AverageUtilisation__]": 0.788890974963097,
     "[SumLeave_Unaffected_by_UT]": 95980.5
     },
     {
     "Date[MMM-YYYY]": "Aug-2022",
     "Date[MonthYrSort]": 202208,
     "User[Staff Name]": "Test User",
     "Department[Practice]": "GOP",
     "[IsGrandTotalRowTotal]": false,
     "[SumBillable_Hours]": 165,
     "[SumTotal_Hours]": 184,
     "[AverageUtilisation__]": 0.9375

     
    Output of the Select action:

    [
     {
     "Month_Year": null,
     "Staff_Name": null
     },
     {
     "Month_Year": "Aug-2022",
     "Staff_Name": "Test User"

     

  • Verified answer
    therush321 Profile Picture
    on at

    I managed to use the Parse JSON action and it worked.

    Had to adjust the apply to each code with the expression below:

     

    body('Parse_JSON')?['firstTableRows']

     

     

    therush321_0-1692285265227.png

     



  • sujatarao Profile Picture
    8 on at

    Hi Could you please show me what you have written inside insert statement. 

  • therush321 Profile Picture
    on at

    @sujatarao I just selected the fields needed to insert a row into my SQL table, mapping the fields from my parse JSON statement at the top. So no SQL code is written here.

  • sujatarao Profile Picture
    8 on at

    @therush321 I am trying to insert output from json file into azure sql db , but it seems 

    body('Parse_JSON')?['firstTableRows']

    is not working in apply to each step . 

     

    sujatarao_1-1709545677976.png

     

    attaching my workflow here: till parse its working fine, I am stuck after that step 

    sujatarao_2-1709545744956.png

     

     

     


     

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

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard