cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
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

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
Dual Super User II
Dual Super User II

Hi @Jose1 

 

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

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.

 

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

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
New Super Users

Meet the Power Automate Super Users!

Many congratulations to the Season 1 2021 Flownaut Crew!

New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

MPA Community Blog

Power Automate Community Blog

Check out the community blog page where you can find valuable learning material from community and product team members!

Users online (10,947)