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

Community site session details

Session Id :
Power Apps - Building 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:
I have the same question (0)
  • Verified answer
    BCLS776 Profile Picture
    8,990 Moderator on at
    Re: "Dynamic" connection to Sharepoint Lists

    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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Chiara Carbone – Community Spotlight

We are honored to recognize Chiara Carbone as our Community Spotlight for November…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 624 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 384 Super User 2025 Season 2

#3
developerAJ Profile Picture

developerAJ 246

Last 30 days Overall leaderboard