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

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 III
Super User III

Hi @Andie ,

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 III
Super User III

Hi @Andie, 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 III
Super User III

Hi @Andie ,

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 III
Super User III

Hi @Andie, 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

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Power Apps June 2021

June Power Apps Community Call

Don't miss the call this month on June 16th - 8a PDT

Top Solution Authors
Top Kudoed Authors
Users online (17,495)