Dear Community,
I'm currently building a powerapp and struggling about to implement the following functionality:
I would like to make my app available for different sites within our company but at the same time restrict the access so that not everyone who has access to the app will be able to access the data from all the sites.
What I have done so far (see also attached picture with my table structure):
- I have created a table (using sharepoint lists) with our different locations
- created a second table which holds my users and I have added a lookup column linked to the locations table to be able to assign a user to one or multiple locations
- After the login screen of my app I have added a gallery which displays all the locations from my location table
- A user can select the location he wants to work on further and move to the next screen
My requirement:
- I want to basically display within this location gallery only the locations to which the user has currently access to (like maintained within the user table)
I have already tried to play around with the Search & Filter functions on the gallery item but I'm struggling to get this working due to multiple reasons.
Anyone has any ideas how I can achive this?
Solved! Go to Solution.
Try:
Filter(LocationTable, PlantCode in MyPlantCode)
------------
If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.
Your description is very detailed, good.
Do a LooKup to pick the PlantCode which is the common field OnStart of the App:
Set(MyPlantCode,LookUp(AuthorisationTable,Username=User().FullName,PlantCode))
Then to filter the Location table:
Filter(LocationTable, PlantCode= MyPlantCode)
------------
If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.
Hi eka24,
thanks for your help! I have tried to apply your steps however I'm struggling because the "PlantCode" Column is a multivalue lookup column.
The first part works fine but I'm not able to apply the filter as there's a DataType Mismatch: The MyPlantCode variable contains a table value (from the Sharepoint lookup column) but the filter expects a Text value.
Any idea how I could resolve this? Also the gallery should be filtered by all PlantCodes assigned to the current user.
Thanks,
Try:
Filter(LocationTable, PlantCode in MyPlantCode)
------------
If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.
I got it working by modifying your given formula a little bit:
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.
User | Count |
---|---|
184 | |
51 | |
47 | |
34 | |
32 |
User | Count |
---|---|
258 | |
87 | |
77 | |
68 | |
67 |