cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Advocate II
Advocate II

Execute a SQL Query Not Recognizing Table

Hello,

 

I am building a flow that queries Azure SQL. I'm trying to trigger the flow from PowerApps; however, the flow fails because the Execute a SQL Query states that I'm using an invalid object. The odd part is if I use a flow without he PowerApps trigger, the action finds the object, i.e. it is no longer invalid

 

( for some reason, I was not able to add an image.)

 

Has anyone experienced this before?

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Advocate II
Advocate II

Re: Execute a SQL Query Not Recognizing Table

I figured it out....(smh)

 

On the Execute a SQL query action, you can specify the database, which I did correctly. However, when you run a test, the connection defaults to a different database. As a result, it was having trouble finding the object. Once I switched the connection, it worked.

 

Thank you for your time. I appreciate it.

View solution in original post

4 REPLIES 4
Highlighted
Dual Super User III
Dual Super User III

Re: Execute a SQL Query Not Recognizing Table

Hi @Jose1 

 

Whle triggering the flow from powerapps, what parameters are you passing? It would be really helpful if you could add a Screenshot!

Highlighted
Advocate II
Advocate II

Re: Execute a SQL Query Not Recognizing Table

Nothing yet. I am building it and using a placeholder for the queries.

 

If I switch out the powerapps trigger, the query executes. If I include it, the query returns an error stating that the object does not exist.

 

Is there something specific I need to do to be able to include screenshots? I keep pasting in the text editor but nothing occurs. I even click on the photos option on the rich text editor and nothing.

 

Highlighted
Advocate II
Advocate II

Re: Execute a SQL Query Not Recognizing Table

I figured it out....(smh)

 

On the Execute a SQL query action, you can specify the database, which I did correctly. However, when you run a test, the connection defaults to a different database. As a result, it was having trouble finding the object. Once I switched the connection, it worked.

 

Thank you for your time. I appreciate it.

View solution in original post

Highlighted
Super User
Super User

Re: Execute a SQL Query Not Recognizing Table

Hehe, jip @Jose1  this has caught me out various times as well 😉

 

FYI: Below are two videos dealing with advanced queries to SQL from PowerApps (using Flow).
For SQL Azure you can use direct (native) queries:
https://youtu.be/DII10gK715I

 

For on-premesis SQL servers, native queries are not supported from Flow (you will get an error: operation Execute Native Sql is currently not supported using an on-prem gateway connection), so we have to use stored procedures to accomplish the same:
https://youtu.be/BAGBzI4zdww

 

Dawid van Heerden
Follow on Twitter: @davestechtips
Subscribe to YouTube: https://www.youtube.com/davestechtips?sub_confirmation=1
**If you found this reply helpful, please mark this as the answer to close the topic and make it easier to find for other people with similar questions.

Helpful resources

Announcements
firstImage

Super User Program Update

Three Super User rank tiers have been launched!

firstImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

Top Solution Authors
Users online (7,364)