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 / Unable to execute SQL ...
Power Automate
Answered

Unable to execute SQL query using power automate desktop

(0) ShareShare
ReportReport
Posted on by 49

I have open sql connection from Variable which in an Excel file. 

now I am trying to execute SQL statement  as in my excel there are lots of columns but I have to execute 

the query select only required columns like B, I X and O , where I need to put conditions  X contacting text B,C,D,E,D+ only select B, C 

and  X <6000,

 

I tired to do it but I am not getting the required result and showing error each time .

 

Appreciate if get any support on this , Thank you in advance.

 

image.png

 

 

Regards,

 

I have the same question (0)
  • Verified answer
    Kresimir_RPA Profile Picture
    286 on at

    Hello Hana,

     

    Can you copy/paste just the  text for SQL statement?

    From the picture presented it seams that you didn't set the SQL connection in the field, and also the names of the excel columns should be written within square brackets, sheet ending with $.

    Something like this:

     

    select [Quote],[CustomerName] from [TEIEnquiryRegister$]
    where [SalesPrice] >= 50000000 and [Category] = 'C'

     

  • Hana123TEI Profile Picture
    49 on at

    Hello @Kresimir_RPA 

    Thank you for the quick response. it work with me.

     

  • eddya101 Profile Picture
    2 on at

    Ref: https://infrontconsulting.asia/power-automate-return-value-from-execute-a-sql-query-v2/

     

    You can use the expression    body(‘Execute_a_SQL_query_(V2)’)

     

    Replacing the spaces in the action name with _

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 298 Super User 2026 Season 2

#2
trice602 Profile Picture

trice602 159 Super User 2026 Season 2

#3
11manish Profile Picture

11manish 150 Super User 2026 Season 2

Last 30 days Overall leaderboard