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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Pages / Redirect to Specific P...
Power Pages
Unanswered

Redirect to Specific Page after Login

(0) ShareShare
ReportReport
Posted on by 1,510

Hi,

 

Once user sign in using local sign in or Azure AD, user must redirect to specific page.

Categories:
I have the same question (0)
  • ragavanrajan Profile Picture
    7,044 Most Valuable Professional on at

    Hi @hardikv 

     

    Have a look at the below thread mate. 

    https://powerusers.microsoft.com/t5/Power-Apps-Portals/Redirect-after-T-amp-C/m-p/912659#M7102 

    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.

     

  • Verified answer
    Christian Leverenz Profile Picture
    1,214 on at

    Hi @hardikv ,

    did you have a look on https://docs.microsoft.com/en-us/powerapps/maker/portals/liquid/liquid-objects#user ?

    In fact if there is the need for a user-specific page you could look, whether you are on the home or profilepage or whatever and in case of logged in user navigate to a page, which is somehow user-dependent.

    You could also look, whether your page referrer was the login. may be, this could help to identify, that you just logged in...

     

    Hope i got the question right, have fun,

      Christian

  • ragavanrajan Profile Picture
    7,044 Most Valuable Professional on at

    Hi @hardikv 

     

    The preferred and standard way is to change the liquid scripting in the Home web template. 

     

    The example below is redirecting to the "contact-us" page. 

     

    {% if user %}
    //if any user logs in
    <script>
     window.location.href='./contact-us/'
    </script>
    {% else %}
    //Home web page code, if you don't want to display the page when the user is being redirected
    {% endif %}
    //Home web page code, if you want to display the page when the user is being redirected

     

    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.

  • H V Profile Picture
    1,510 on at

    Hi @ragavanrajan  & @chleverenz 

     

    Thanks for your suggestion.

     

    I have tried to modify Home Web Template and redirect to specific page. However it is not working as expected.

     

    {% if user %}
    <script>
     window.location.href='./contact-us/'
    </script>
    {% else %}
    
    <div class="wrapper-body">
     <section class="page_section section-landing">
     <div class="container">
     <div class="row ">
     <div class="col-md-12">
     <br>
     <br>
     <br>
     <br>
     <h1 class="section-landing-heading">{% editable snippets 'Home/Title' type: 'text' %}</h1><br>
     <h2 class="section-landing-sub-heading">{% editable page 'adx_summary' type: 'html', liquid: true %}</h2>
     <br>
     <br>
     </div>
     </div>
     </div>
     </section>
    
     <section class="page_section">
     <div class="layer_up">&nbsp;</div>
     <div class="container">
     <div class="content-home">
     {% include 'Page Copy' %}
     </div>
     </div>
     <div class="layer_down">&nbsp;</div>
     </section>
    <div class="push"></div>
    </div>
    
    {% endif %}

     

  • Verified answer
    ragavanrajan Profile Picture
    7,044 Most Valuable Professional on at

    Hi @hardikv 

     

    Place the below code in your profile web page (Localised content > Custom JavaScript) or any web page depending on your business need. 

     

    $( document ).ready(function() {
     console.log(555,"Redirect check");
     $(location).attr('href', 'https://yourportal.powerappsportals.com/contact-us/');
    
    });
    
    
    

     

    Done the testing. It is redirecting to contacts page in my case. 


    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.

  • H V Profile Picture
    1,510 on at

    Thanks @ragavanrajan 

     

    I have tried above code and it is working.

    So, If I put below code in Home - Localized Content Web Page and it is working fine.

    $( document ).ready(function() {
     var userData = "{{user.id}}";
     if(userData != undefined && userData != null && userData != "")
     {
     $(location).attr('href', 'https://yourportal.powerappsportals.com/contact-us/');
     }
    });

     

    If I put above code in Web Page directly, then it is not working. Is there any reason?

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Pages

#1
Jerry-IN Profile Picture

Jerry-IN 71

#2
Fubar Profile Picture

Fubar 62 Super User 2025 Season 2

#3
sannavajjala87 Profile Picture

sannavajjala87 31

Last 30 days Overall leaderboard