cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Emalong94
Frequent Visitor

Dinamic data-tables depending on the User(): different data for different Users

Hi Dears,

 

I've been creating an App to run the salary review process on a global scale, upgrading from Excel templates.

 

Scenario: I have 20 Managers, for each one I have an Excel template (data-table for the App) listing their direct reports and a bunch of information (current salary, hire date etc.).

The App will allow them to see the information of their subordinates and update their salary information.

My only little, gigantic problem is that I need to change the referenced data-table on the basis of the User().

 

I created a log-in page as a starting point, now I basically need to link the password (or the User itself) to the relevant data-table, this is critical.

 

You think this might be doable in PowerApps?

 

Thank you!!!

 

2 ACCEPTED SOLUTIONS

Accepted Solutions
KRider
Resolver II
Resolver II

Yes this is absolutely doable. You can use Office365Users.MyProfileV2().displayName or

Office365Users.MyProfileV2().mail (This gets their email). 

 

You could either create a dropdown with your 20 managers to sort based on the dropdown.Selected.Value

or just read from the Office265Users to display the information. Hope this helps.

View solution in original post

Masino
Super User
Super User

Sure,
You can use both 

Office365Users.MyProfileV2().displayName or Office365Users.MyProfileV2().mail, depending on your needs.

or even better,

 

user().fullname or user().email


So you can hide some sections of your program based on who is logged in 😉 


example... OnVisible= If(user().mail='your@contact.email'; true;false

 

and so on

View solution in original post

8 REPLIES 8
KRider
Resolver II
Resolver II

Yes this is absolutely doable. You can use Office365Users.MyProfileV2().displayName or

Office365Users.MyProfileV2().mail (This gets their email). 

 

You could either create a dropdown with your 20 managers to sort based on the dropdown.Selected.Value

or just read from the Office265Users to display the information. Hope this helps.

phipps0218
Super User
Super User

Yes you can link the user to the data if you have this as a field in the datasource. Then based on the logged in user you filter the data coming into the app.

 

Please Accept as Solution if it solves your question. Or just give it a Thumbs Up if it is helpful because this can help others.

LinkedIn: https://www.linkedin.com/in/charlie-phipps-%F0%9F%91%A8%E2%80%8D%F0%9F%92%BB-91338715b/
YouTube: https://www.youtube.com/channel/UChmFBGU1YKIU91sNMQ7buGg
Twitter: https://twitter.com/phipps0218

Masino
Super User
Super User

Sure,
You can use both 

Office365Users.MyProfileV2().displayName or Office365Users.MyProfileV2().mail, depending on your needs.

or even better,

 

user().fullname or user().email


So you can hide some sections of your program based on who is logged in 😉 


example... OnVisible= If(user().mail='your@contact.email'; true;false

 

and so on

It is always best to use email rather than full name because names can have discrepancies. Especially with case sensitive. 

Emalong94
Frequent Visitor

Thank you guys!

 

This is great.

Just one doubt: I don't need to hide/get visible some parts of the App, the UX should always remain the same, what changes is the data feeding Galleries, Lables and so on. 

 

Managers are basically supposed to:

Scroll their subordinates (Gallery)

View their Information (View Form)

Edit the Salary (Edit Form)

 

This is why I have 20 different Excel files which I should import in the App. Do you confirm I can filter Galleries and Forms by Office365Users.MyProfileV2()?

Masino
Super User
Super User

..Never, never, never use excel as a database. Better to use a list in Sharepoint at this point!
 But,....

"This is why I have 20 different Excel files which I should import in the App. Do you confirm I can filter Galleries and Forms by Office365Users.MyProfileV2()?"

 

Yes you could, but shouldn't 😛

**bleep** right,

 

Unfortunately the Excel spreadsheet comes from another department and they want to keep using them. 

So I'm finding the best way to use them as database but at least improving the manager's user experience.

 

Thank you 10000!!!

Why isn't this a good option? Just curious as I have used it to separate what Team Leaders and Managers can see? Still learning the finer workings of Power Apps I guess. hahaha

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (31,655)