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 / Dynamically change Dat...
Power Apps
Answered

Dynamically change Dataverse source in PowerApps

(0) ShareShare
ReportReport
Posted on by 27

Hi all,

 

I have a Canvas app, in which I'd like users to be able to see a specific Dataverse table.

This table contains a File type column with an attachment, which the user should be able to download.

 

This I have been able to implement by linking a Gallery to the Dataverse table, and adding a button within each row item of the gallery, pointing to the URL of the attachment, which very roughly looks like:

environmentURL/DataverseAPI/TableGUID/ColumnName/value

 

The trick:
My users belong to 50 different companies. This information (i.e. which company the user belongs to) is automatically picked up by my App once they log in. What I want is users to be able to see and download attachments from their company-specific Dataverse table, which is automatically chosen and displayed upon login. This means dynamically changing the data source depending on the user.

 

I suspect I'll need PowerAutomate which could be triggered automatically on start of the App to fetch the right Dataverse table using the user information. But after this I would not know how to proceed. Maybe I use the 'List Rows' step in Power Automate? I feed it into a 'Respond to a Power App or Flow' step, which then stores it in a collection..?. I tried things such as this but to no avail..

 

 

Many thanks for your help!!!

 

 

Best,
Christopher

Categories:
I have the same question (0)
  • Verified answer
    Rusk Profile Picture
    1,369 Super User 2024 Season 1 on at

    Hi @Christopher5 

     

    To be sure I understand, you have one app for 50 different customers? So you have 50 different tables? That in itself sounds problematic to me.

     

    But I would like to suggest you avoid trying to change your data source.  You can have your data source for each table in the app, then change the table based on the user.  However, you shouldn't add more than 30 data sources:

    https://learn.microsoft.com/en-us/power-apps/maker/canvas-apps/performance-tips#limit-data-connections

    I don't know why you're structuring your app / tables in the way that you are, but it sounds kind of odd to try to cram 50 different use cases into one app.  Can you explain what the goal is here?  If you just want specific people to download specific attachments, you can add a column to your table that lists company name and then just filter your table by that.  One table for all, then filter it?

  • Christopher5 Profile Picture
    27 on at

    Hi Rusk,

     

    Firstly thanks for the reply and taking a step back to question things.

     

    My app services 50 different companies, and each will have about 2-3 users.

    They are able to upload data through this app, and then retrieve a report after a process (analysis of their data) runs in the background. Each of these reports is specific to the company, and users should not be able to access other companies' reports. These users are being migrated from a portal currently built with SAS and HTML.

     

    The reason I talk about 50 different tables, is that this emulates the folder structure present in the legacy system. I did not apply enough critical thinking to realize the same can be accomplished with indeed 1 table.

     

    Do you know of any limitations which would prevent me from having a table with 50-60 columns?

    If not, you solved my issue:)

     

     

  • Rusk Profile Picture
    1,369 Super User 2024 Season 1 on at

    Hi @Christopher5 

     

    50 columns would also be a bit problematic (https://learn.microsoft.com/en-us/power-apps/maker/canvas-apps/common-performance-issue-resolutions#too-many-columns-retrieved).  I was imagining a table structured more like this:

    Rusk_0-1692389161820.png

    Using a variable capture on App Start for the user, maybe it sets the company name or something similar, I would then filter it:

    Rusk_1-1692389272170.png

     

    My variable in this example is set to "Company 2", and as a user that works for Company 2 I can only see my items.

     

    However, I don't know if this is feasible with the amount of data you may be retrieving for each company.  It could be too large of a dataset and cause loading issues. 

     

    What if you just had a separate app for each company 😮

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!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 549 Most Valuable Professional

#2
Kalathiya Profile Picture

Kalathiya 225 Super User 2026 Season 1

#3
Haque Profile Picture

Haque 224

Last 30 days Overall leaderboard