cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
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
v-xida-msft
Community Support
Community Support

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
Drrickryp
Super User II
Super User II

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.

v-xida-msft
Community Support
Community Support

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
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

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

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 (109,907)