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 / Dynamic Database Selec...
Power Automate
Answered

Dynamic Database Selection in Execute a SQL Query

(0) ShareShare
ReportReport
Posted on by 14

Hi all,

I am currently working on an PowerApp for editing a certain table that is common between several of our databases. 

I need to be able to specify, through the PowerApp, which database (chosen from a list) to connect to and pull data from.  Unfortunately Execute a SQL Query (V2) doesn't seem to like dynamic parameters for the Database input and tells me the datasource is invalid.

My question is.. is there any way to do this?  Specifying the database to connect to as a parameter for the flow at runtime.

Categories:
I have the same question (0)
  • IDBdesign Profile Picture
    14 on at

    @Pstork1  You had it right initially lol.  I was hitting the same server but different databases.

    Figured it out though.  You can click the vertical ellipsis on the side of the Execute a SQL Query action to change the connection.

     

    Appreciate your help 🙂

  • Pstork1 Profile Picture
    68,863 Most Valuable Professional on at

    Sorry, I used the wrong terminology.  Assuming you are hitting the same server and the same database you only need one connection.  But you would create multiple Actions in parallel paths in the switch statement.

     

    screenshot.png

  • IDBdesign Profile Picture
    14 on at

    Hi @Pstork1, thank you for your response.

     

    I am trying to achieve the method you described in your response using the switch statement, however I am having trouble using more than one connection.  Are multiple SQL connections not supported?

  • Verified answer
    Pstork1 Profile Picture
    68,863 Most Valuable Professional on at

    There is no support at this point for dynamic selection of the database, since it is used to create the connector.  The only workaround I've seen is to use a switch that keys off the database and then use multiple connectors pre-configured for each database.  When you select a specific database it switches to a parallel path that uses the appropriate connection.

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
David_MA Profile Picture

David_MA 265 Super User 2025 Season 2

#2
Expiscornovus Profile Picture

Expiscornovus 203 Most Valuable Professional

#3
trice602 Profile Picture

trice602 202 Super User 2025 Season 2

Last 30 days Overall leaderboard