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 Apps / Can a datasource be a ...
Power Apps
Unanswered

Can a datasource be a variable?

(1) ShareShare
ReportReport
Posted on by 90

Hello,

I have a canvas app with multiple screens that reference the same datasource.  I haev a Dev Sharepoint list that I use to test new features that are to be added to the app.  Is it possible to have a variable set for the datasource so I can change the datasource in one location that will update across the app?

I have a text label that I use to put the version set to a variable so I can update it in one location.

I have tried it and using 'Set(varData, datasource) works but adding the variable does not bring up the data (ex: a dropdown that searches the SP list).

Categories:
I have the same question (0)
  • Pstork1 Profile Picture
    68,697 Most Valuable Professional on at

    If the datasource is SharePoint, Dataverse, or SAP then you can use an Environment Variable for the data source.  But other than environment variables there is no way to use variables to manage data sources.  You can read about environment variables here: Use environment variables in solutions - Power Apps | Microsoft Learn

  • CPGDallas Profile Picture
    90 on at
    I decided to completely separate the app and dev datasource. It will mean a bit more work when I finalize the app when working with the dev datasource but in the long run it's an overall improvement.  The app would need to have both datasources connected and I really don't need a dev datasource hanging out in the background of my prod app.
    Thank you for the info.
  • Michael E. Gernaey Profile Picture
    53,315 Super User 2025 Season 2 on at
     
    If you want this, you should use Environment Variables. As it is exactly what you are explaining.
     
    You would create an environment variable that would Connect to Dev, when you are running in Dev, then it would connect to Test, UAT, Prod or whatever when you are in those. It simply is updated as you install the solution and bingo bango done. literally 2.5 seconds
     
    As a matter of fact, if you turn on the setting for it to automatically created DataSource Environment Variables... you won't even have to do that. Just turn on the feature.
     
    It sounds like maybe you thought it was something else?
     
    As @Pstork1 mentioned it with the link, I thought maybe there might be some confusion as really its the correct answer. The only additional point was me saying to turn on it doing it for you automatically.
     
    Would love to understand :-) so we can make sure its understand and if you found some issue we can let others know too.,
     
    If this helps you, please Mark as such.

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 Apps

#1
WarrenBelz Profile Picture

WarrenBelz 796 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard