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

Filter data based on projects assigned to user

Hi,

 

I am currently working on app in which users will only have access to projects that they are assigned to. I have a sharepoint list for users which has a column for project access that is looked up to another database. Data on the app should be filtered based on the project access. Hoping that someone can help me out.

 

Thanks in advance. 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support
Community Support

Re: Filter data based on projects assigned to user

Hi @Anonymous,

 

Could you please share a bit more about your SP list?

How do you display the projects within your app? Using a Gallery control?

 

I assume that you display the projects within your app using a Gallery control, and you only want the current user to access the projects that they are assigned to.

 

I have create two SP lists on my side, the data structure as below:

 

Users List:7.JPG

Note: The User Name column is a Single line of text type column in my Users list.

 

Products List:8.JPG

Note: The Assign To column is a Lookup type column in my Products list, which references values from the User Name column in my Users list. The Assign To column acts as the Project access column that you mentioned.

 

I have made a test on my side, please take a try with the following workaround:9.JPG

 

 

Set the Items property of the Gallery control to following formula:

Filter('20180821_case8_Projects',Assign_x0020_To.Value=User().FullName)

 

More details about the User function in PowerApps, please check the following article:

User function

 

Best regards,

Kris

 

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
Super User
Super User

Re: Filter data based on projects assigned to user

Hi Marie Claire,

 

Powerapps has a function User() that captures the current user and can specify FullName, Image or Email. ie.User().FullName placed in a label will return the full name of the user.  If your Projects table has the identical name associated with a project, you could use that to filter a data table or gallery. So if your Data Source is called Projects and it contains a column named Users with their full names, then make the Items property of a DataTable or Gallery: Filter(Projects, Users=User().FullName).  Please let me know if this works.

Community Support
Community Support

Re: Filter data based on projects assigned to user

Hi @Anonymous,

 

Could you please share a bit more about your SP list?

How do you display the projects within your app? Using a Gallery control?

 

I assume that you display the projects within your app using a Gallery control, and you only want the current user to access the projects that they are assigned to.

 

I have create two SP lists on my side, the data structure as below:

 

Users List:7.JPG

Note: The User Name column is a Single line of text type column in my Users list.

 

Products List:8.JPG

Note: The Assign To column is a Lookup type column in my Products list, which references values from the User Name column in my Users list. The Assign To column acts as the Project access column that you mentioned.

 

I have made a test on my side, please take a try with the following workaround:9.JPG

 

 

Set the Items property of the Gallery control to following formula:

Filter('20180821_case8_Projects',Assign_x0020_To.Value=User().FullName)

 

More details about the User function in PowerApps, please check the following article:

User function

 

Best regards,

Kris

 

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Helpful resources

Announcements
MBAS Gallery 2020

MBAS Gallery 2020

Watch Microsoft Business Applications Summit sessions on-demand.

firstImage

New Ranks and Rank Icons released on April 21!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power Apps Community!

Top Solution Authors
Top Kudoed Authors
Users online (9,289)