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 / Switch between DataSou...
Power Apps
Unanswered

Switch between DataSources

(0) ShareShare
ReportReport
Posted on by 1
Hello,
I'm fairly new with Power Apps. I'm creating an IT Inventory App. Each Site has a different SharePoint list of Inventory for the respective site. The main screen of the app I have a combo box to select the site which also selects respective SharePoint list, the next screen displays the sites list in a gallery. Selecting an item navigates to the next screen which is a form. The problem is when editing the item it will only edit the one Sharepoint list. I did look this up and set the datasource of the form to a global variable, the OnChange property of the Combo box is set too 
If(ComboBox2_1.Selected.Value = "SiteA", Set(varDataSource, StockroomATest), Set(varDataSource, StockroomBTest))
Getting the following error when setting the Onchange value to this; Incompatible type. We can't evaluate your formula because the context variable types are incompatible with the types of values in other places in your app.
 
I have the same question (0)
  • WarrenBelz Profile Picture
    153,079 Most Valuable Professional on at
    Firstly, you cannot dynamically refer to data sources with Variables, hence the error. The other issue you will face is that Power Apps Table controls such as Galleries and drop-downs as well as Forms do not work when faced with alternative data sources in their Items/Item. The easiest way is to have two sets of controls (gallery/form etc), with each set visible based on a Variable.
     
    Please click Does this answer your question if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it a Like.
    MVP (Business Applications)    Visit my blog Practical Power Apps    LinkedIn   

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 721 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 320 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard