
Power Pages: how to get contact's Dataverse team membership in web template with Liquid
When building internal portals on Power Pages, you often need to drive UI logic based on who the logged-in user is in Dataverse - not just their portal web roles, but their actual Dataverse team memberships. This post shows the correct approach and why the obvious path doesn't work. The naive approach - and why it fails The logged-in user in a portal is a contact record. Your first instinct might be to traverse owninguser on the contact to get the backing systemuser , then look up their team memberships from there: {% assign systemuserId = entities . contact [ user . contactid ][ 'owninguser' ]. id %} {% assign teams = entities . systemuser [ systemuserId ][ 'teammembership_association' ] %} This doesn't work. In the portal context, owninguser on the contact is always the same portal service account - not the actual logged-in person. You'll get the same result for every user. The correct approach - start from the team Instead of starting from the user and looking up their teams, start
Continue reading on Dev.to
Opens in a new tab



