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 / Variable data source
Power Apps
Answered

Variable data source

(0) ShareShare
ReportReport
Posted on by 61

Hello, I want to store variable data sources to the user, so if he is from department A, then he gets table department A, if another employee opens the app, he can only look at and edit the table from department B. I've already got the ad by backing it up in the OnStart command. Only the patch function I can not use so, someone an idea?

 

OnStart:

If(StartsWith('Office365-Benutzer'.MyProfileV2().department;"NETZ TBM");
Set(vartblBoxen; tbl_Boxen_TBM);;Set(vartblGeräte; tbl_Geräte_TBM);;Set(vartblBetriebsservices; tbl_Betriebsservices_TBM);;Set(vartblBenutzer; tbl_Benutzer_TBM))

 

Patch:

dv1407_0-1620655332610.png

 

Categories:
  • Verified answer
    RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @dv1407 

    PowerApps is highly dependent on the schema of datasources.  You cannot switch them around like that in PowerApps.

     

    I would suggest instead that you utilize multiple EditForm's instead of patching, and then each EditForm can be associated with different datasources.  Then simply change the Visibility of the Form based on the user department.

    It will be immensely easier than what you are trying to do...which PowerApps will not allow.

     

    I hope this is helpful for you. 

     

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

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 409 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 252 Most Valuable Professional

Last 30 days Overall leaderboard