web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / "Dynamic" connection t...
Power Apps
Answered

"Dynamic" connection to Sharepoint Lists

(1) ShareShare
ReportReport
Posted on by 34

Hello,

 

We have a solution that requires to split data into several similar Sharepoint lists: they have the same field/column structure and the only difference is the data per region.

 

We've tried setting a variable with the desired list to connect and it worked, for a while. Here's what we did:

 

Set(glDataSource,Switch(varDataSource,1,List01,2,List02,3,List03,4,List04,5,List05,6,List06,7,List07));

 

 

So depending on a choice made in the app's main screen, we'll have a number indicating which list will be used. Like this:

 

ShowColumns(Filter(glDataSource,Product = varProducttoFilter ),"ID","Column1","Column2","Column3")

 

 

So with just one line we can connect on the "active" list without any hassle. As said, it worked until we've reached the row limit for delegation (even though there is no clear indication of delegation). We did tests and seems that when connecting through this way, everything becomes not delegable.

 

So, is there any other idea to connect on different list based on a indicator stored in a variable? 

 

I'd like to avoid doing something very manual like this:

 

[...Code...]

Switch(varDataSource,
 1,ShowColumns(Filter(List01,Product = varProducttoFilter),"ID","Column1"),
 2,ShowColumns(Filter(List02,Product = varProducttoFilter),"ID","Column1"),
 3,ShowColumns(Filter(List03,Product = varProducttoFilter),"ID","Column1"),
 4,ShowColumns(Filter(List04,Product = varProducttoFilter),"ID","Column1"),
 5,ShowColumns(Filter(List05,Product = varProducttoFilter),"ID","Column1")
);

[... Code ...]

 

Thanks in advance!

Categories:
  • Verified answer
    BCLS776 Profile Picture
    8,994 Moderator on at

    As you've discovered, Power Apps cannot link to a data source dynamically at run time - all data sources have to be pre-defined so the service can enforce data types.

     

    The way of handling optional data sources using a Switch() statement will work. Another option, if it fits your use case, is to make completely separate apps for different regions. Each app would then only need to connect to daa sources applicable to its region.

     

    Hope that helps,

    Bryan

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 236 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 188 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 130

Last 30 days Overall leaderboard