Power Apps Portal Filter on Current Contact
With Power Apps Portals you can share data from Dataverse to your Contacts, moreover you can control what those contacts are allowed to see.
In this post we will see different ways to filter data based on the signed-in contact on the portal.
1. Table Permissions or Entity Permissions
In this example we will display cases opened by the current contact signed-in using Table Permission :
Create a new record in Table Permission as follow:
Table Name : Case.
Access Type : Contact (this will limit access to only records associated to the signed-in user).
Contact Relationship : incident_customer_contacts (this mean the current contact is the customer incident)
Once saved add your Web Role and display the list on a page, what ever the view you select the system will filter only on the cases where the customer is the current contact.
2. Filtered View
The solution with Table Permission will prevent accessing to records where the customer are not the current contact, but what if you wish to display all the cases with possibility to switch for a view filtered by the current contact.
You can achieve this using a filtered view as follow:
Create a contact where the name is "Poratl User"
Next create a system view where the customer is the contact created before ( Portal User )
Add this view to be displayed in your list, and do not forget to change the Table permission access type to global or account depending on what you want to display to the users, in this case I will change to it global
Save your portal and Sync Configuration and this should work perfectly.