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 Automate
Answered

sql query results

(0) ShareShare
ReportReport
Posted on by 72

I have a PAD where I am running a SQL statement to calculate a rather complex time differential equation. where the query executes their will only ever be 1 value return in the output. It appears that the output of the SQL statement comes back as a data table with 1 column and 1 row. I need to be able to use this value as part of another calculation further down in my PAD process but can't seem to find the best way to get the value out as a variable to use. Any help or guidance would be greatly appreciated.

I have the same question (0)
  • Verified answer
    LokeshBysani Profile Picture
    229 Super User 2024 Season 1 on at

    @lkhall_37203  Lets say you have a datatable variable called %SQLResultsTable% with 1 row and 1 column as below and if you want to extract the result 45 and use it in downstream. follow this approach.

    1. set variable action and provide a variable name 

    •     %SQLResultsTable[0][0]%  
    • LokeshBysani_1-1692034430367.png

       

    LokeshBysani_0-1692034354283.png

     

  • lkhall_37203 Profile Picture
    72 on at

    thanks, works perfect I was using %SQLResultsTable[0]% which makes sense now why it wasn't working. 

  • LokeshBysani Profile Picture
    229 Super User 2024 Season 1 on at

    @lkhall_37203 When working with data tables in Power Automate, you can use the following approaches to retrieve specific column values:

    1. To fetch values using row and column indices:

      • %SQLResultsTable[rowindex][columnindex]%
      • For example: %SQLResultsTable[0][0]% (fetches the value from the first row and first column), or %SQLResultsTable[0][2]% (fetches the value from the first row and third column).
    2. To fetch values using column names:

      • %SQLResultsTable[rowindex]['columnName']%
      • For instance: %SQLResultsTable[0]['Result']% (fetches the value from the 'Result' column for the first row).

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!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 557

#2
Valantis Profile Picture

Valantis 328

#3
David_MA Profile Picture

David_MA 264 Super User 2026 Season 1

Last 30 days Overall leaderboard