cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Bind a table (database) by item id

I have one table where all the elements are related by their number. That is, each office, user, and employee Department has a number. Everyone has an id. I can 't change the table itself!!! Whether I can link all elements in power apps by id to a single collection. So that the user logs in and sees the data intended for their Department.

 

 

2 ACCEPTED SOLUTIONS

Accepted Solutions
WarrenBelz
Super User
Super User

Hi @Anonymous ,

You can certainly restrict this in a number of ways.

There are many other possibilities including adding have a control list with the user's email and their department - I will call it RefList and the fields RefDept and UserEmail in the example below. A gallery Items property would be

Filter(
   YourDataSourceName,
   Lookup(
      RefList,
      UserEmail = User().Email
   ).RefDept = Department
)

Also if you want to only display the records created by the logged-in user, you can have a gallery with the Items property

Filter(
   YourDataSourceName,
   'Created By'.DisplayName = User().FullName
)

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

View solution in original post

eka24
Super User
Super User

Hi @Anonymous, To be able to filter based on a user, you should have a column that has email or FullName. Then you can:
Filter(
DataSourceName,UserEmailColumn=
User().Email)
With this the user would see records of only his department

View solution in original post

2 REPLIES 2
WarrenBelz
Super User
Super User

Hi @Anonymous ,

You can certainly restrict this in a number of ways.

There are many other possibilities including adding have a control list with the user's email and their department - I will call it RefList and the fields RefDept and UserEmail in the example below. A gallery Items property would be

Filter(
   YourDataSourceName,
   Lookup(
      RefList,
      UserEmail = User().Email
   ).RefDept = Department
)

Also if you want to only display the records created by the logged-in user, you can have a gallery with the Items property

Filter(
   YourDataSourceName,
   'Created By'.DisplayName = User().FullName
)

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

eka24
Super User
Super User

Hi @Anonymous, To be able to filter based on a user, you should have a column that has email or FullName. Then you can:
Filter(
DataSourceName,UserEmailColumn=
User().Email)
With this the user would see records of only his department

Helpful resources

Announcements
Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Super User 2 - 2022 Congratulations

Welcome Super Users

The Super User program for 2022 - Season 2 has kicked off!

September Events 2022

Check out all of these events

Attend in person or online, there are incredible conferences and events happening all throughout the month of September.

Government Carousel

New forum: GCC, GCCH, DoD - Federal App Makers (FAM)

In response to the unique and evolving requirements of the United States public sector, Microsoft has created Power Apps US Government.

Users online (1,878)