I have three tables(Entities), one For Countries(This is a unique table with countries), one for the data(The data is imported from an external source into the table), and lastly one for users(contains username, email, and country).
Both the data and user are related to the country table through a lookup column of country.
What I'd want is to share the records through a portal app.
I will later invite contacts to view the records. (I would want them to view the records with regards to their countries).
I've tried researching online, but there isn't a clear way on how to relate records to contacts they have not created or directly own.
Any idea on how to achieve this will be highly appreciated.
Thanks
Knowing the contacts aren't record owners to the data table? How do I invite them in such a way that I will ensure they see only the countries they are members of.
You need to set Entity Permissions and associate them with a Web Role assigned to the Contact, depending on exactly what you need to do depends on what the Scope of the Entity Permission needs to be. Depending on the Scope of the Entity Permission you will be prompted to select the Relationship between the entities.
https://docs.microsoft.com/en-us/powerapps/maker/portals/configure/assign-entity-permissions
A user in the Portals is always represented by a Contact record in your CDS, so you need that relationship to exist if you want to filter your data.
If you already have licensed users in your system, you can add logic in your CDS to create a contact record for each user and associate to the corresponding contact in your "Country" records.
Power Pages Super User | MVP