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 SharePoint Lis...
Power Apps
Answered

Dynamic SharePoint List datasource for Form in Canvas Apps

(0) ShareShare
ReportReport
Posted on by 8,531 Most Valuable Professional

Hello,

 

We have multiple site collections in SharePoint, those site collection use same structure of document libraries, i mean same content type and column. Is it possible to create one Canvas app that can work with all similar libraries of different site collections?

 

Thanks,

Anna Jhaveri

Categories:
I have the same question (0)
  • v-bofeng-msft Profile Picture
    Microsoft Employee on at

    Hi @annajhaveri :

    Could you tell me:

    • Do you want the app to connect to libraries with the same data structure in multiple SharePoint sites?(The answer is "Yes")
    • What's the meaning of "work with"?Could you provide some clear description?

    Best Regards,

    Bof

  • rubin_boer Profile Picture
    4,843 Super User 2024 Season 1 on at

    hi @annajhaveri yes that is possible. Create collections to all the SharePoint libraries and in the app you can either have a menu or button that can switch between the collections.

     

    e.g.

    Two collections: ClearCollect(_A, [1,2,3,4]); ClearCollect(_B,[5,6,7,8])

    gallery Items = If(TextInput6.Text = "a", _A,_B)

     

    Hope tis helps

     
  • annajhaveri Profile Picture
    8,531 Most Valuable Professional on at

    @v-bofeng-msft  thanks for response here are the answers 

     

    • Do you want the app to connect to libraries with the same data structure in multiple SharePoint sites?(The answer is "Yes")
    • Anna: yes, also we would have atleast 50 sites, each site has 15 libraries with same structure, new sites get added in future, which should also work with Canvas app, so we would like one app to work for any library of same structure in site without making changes to Canvas app when new site is created or new library is created, is that possible?
    • What's the meaning of "work with"?Could you provide some clear description?
    • Anna: Work with means the canvas app will be a form, edit form, and to allow user to edit column values for specific document in the canvas app. The form should work for any document library of same structure in any site
  • annajhaveri Profile Picture
    8,531 Most Valuable Professional on at

    @rubin_boer  thanks for response, but that will require me to change the Canvas App when a new library added to add new connection?

  • rubin_boer Profile Picture
    4,843 Super User 2024 Season 1 on at

    hi @annajhaveri yip we have that limitation at runtime but i was looking at this some time ago maybe you will find this helpful.

     

    https://www.c-sharpcorner.com/article/connecting-datasource-dynamically-in-power-apps-using-power-automate-part-1/

    https://www.c-sharpcorner.com/article/connecting-datasource-dynamically-in-power-apps-using-power-automate-part-2/

     

    I have never tried it, but it looks something worthwhile trying.

     

    All the best

     
  • Verified answer
    v-bofeng-msft Profile Picture
    Microsoft Employee on at

    Hi @annajhaveri :

    First of all,according to your description, this app needs to connect to 750 (50*15) data sources. This may be difficult to achieve, because the official recommendation is "Don't connect to more than 30 data sources from the same app."

    I think this link will help you a lot:

    Limit data connections 

    Secondly,one Form cannot support multiple data sources, so I am afraid your request cannot be fulfilled.

    For example:

    If I set the form control's DataSource property to:

     

    Library1

     

    It is fine.

    If I set the form control's DataSource property to:

     

    If(
     condition1,
     Library1,
     condition2,
     Library2,
     condition3,
     Library4
    )

     

    Although this will not cause any error, but this form will not work normally.

    Best Regards,

    Bof

     

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 893

#2
Valantis Profile Picture

Valantis 571

#3
11manish Profile Picture

11manish 482

Last 30 days Overall leaderboard