Hi @Newbie150
Pre: Make sure you create appropriate web roles first in the Power Apps Portals.
You can do this in Power Automate CDS Connector using contact and web role tables.
Step 1: Use the CDS trigger and use contact table to check whether contact is added or modified
Step 2: Get the user using the "Web Roles" Table and match it with the Web role you have created.

Step 3: Use relate records in CDS to map the contact to the web role table.

Note: This will only work if the user trying to sign in to the portal and update their profile page. The event is when they press the "update" button.
Note 1: For Portal, everything is a contact. If your user sign in then the portal will create contact.
Additional: You can assign variables and check for flag value and play with your own logic to relate the contract.
In addition, have a look at the below thread, for more information
https://powerusers.microsoft.com/t5/Power-Apps-Portals/Assign-Web-Role-for-the-Portal-contact/td-p/716720
Hope it helps.
------------
If you like this post, give it a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users to find it.