web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :

PowerApps Portals - Change Default Landing Page For Portal Users

Arpit Shrivastava Profile Picture Arpit Shrivastava 7,518 User Group Leader



Hi All,

Welcome to my Power Guide Mentorship Program.

Today, I am going to share a #PowerGuideTip16 for PowerApps Portal Developers, who want to manage the redirection of the Portal default landing page.

Requirement:

Redirect Anonymous Portal User to Login Page and Authenticated Portal Users to Home Page,

Solution:

Option 1 - 
Anonymous User Default Landing Page - Login Page
Authenticated User Default Landing Page - OOB Home Page

Go to Portals > Web Template > Home

Update the code as per the following:

{% if user %}
//if a user is logged in then
// Paste OOB Home web template Liquid Code inside this block
{% else %}

<script>
//if user is not loggedin, redirect user to Login page
window.location.href='~/SignIn';
</script>

{% endif %}





Option 2 - 
Anonymous User Default Landing Page - Login Page
Authenticated User Default Landing Page - Custom Page or other than OOB Home Page

{% if user %}
//if a user is logged
<script>
window.location.href='~/<WebpagePartialURL>';
</script>
{% else %}

<script>
//if user is not loggedin, redirect user to Login page
window.location.href='~/SignIn';
</script>

{% endif %}


This was originally posted here.

Comments

*This post is locked for comments