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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Pages / How to manually redire...
Power Pages
Unanswered

How to manually redirect one step to another in webform using JavaScript

(0) ShareShare
ReportReport
Posted on by Microsoft Employee
I have following code added in a webform step's custom JavaScript. When click on Next button after validating some data I want to redirect to the next step but it doesn't work.
 
$(document).ready(function () {
webFormClientValidate = function () {
validateX(function(flag) {
return flag;
});
};
 });
 
function validateX(callback) {
    checkX()
        .then((response) => {
            if (!response) {
                $('html, body').animate({
                    'scrollTop': $('.validation-summary').position().top
                });
            } else {
                var entityId = $('#EntityFormView_EntityID').val();
                return returnPromise1(entityId);
            }
        }).then((entityId) => {
            if (entityId&& entityId.length > 0return returnPromise2(entityId);
        }).then((entityId) => {
            if (entityId&& entityId.length > 0) {
                callback(true);
            }
            else callback(false);
        });

}
 
how can I redirect to the next step using these above code?
Categories:
I have the same question (0)
  • oliver.rodrigues Profile Picture
    9,475 Most Valuable Professional on at

    Hi, just to double check, is this a Power Apps Portals question?

     

    have you followed the documentation: https://docs.microsoft.com/en-us/powerapps/maker/portals/configure/add-custom-javascript


    ------------

    If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi Oliver, 

    Thanks a lot for your reply. 

    I have asked the question related to portal and already added my above code as custom javascript in one of the webform's step. 

     

    -

    Thanks

  • oliver.rodrigues Profile Picture
    9,475 Most Valuable Professional on at

    thanks for clarifying 

     

    I would recommend following MS documentation on the web form validation (link sent previously) 

  • Fubar Profile Picture
    8,493 Super User 2026 Season 1 on at

    Don't think it will work.  Believe the steps (navigation) are managed in a form session stored in CRM e.g. if you are on Step 1 and paste the url from Step 4 think you will find Step 4 is not loaded.

     

    Question would be why do you need to manually load a Step rather than using the existing Condition step logic?

     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Any help on that? I’m facing a similar issue. 
    The reason is that for the condition step logic to work you need an existing record to perform the condition logic on.

    My client is expecting 1000s of forms being filled out with only a fraction qualifying to actually create a record, based on a series of questions. Need to avoid creating 1000s of records that wouldn‘t have a future either way.

     

    My approach is using JavaScript validation on the Next/Submit button with the function webFormClientValidate.

    How would I include a redirect directive in JavaScript on that button?

     

    Please help if you know the answer.


    Best regards,

     

    Jakub Marciniak

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Pages

#1
Valantis Profile Picture

Valantis 49

#2
11manish Profile Picture

11manish 33

#3
Haque Profile Picture

Haque 28

Last 30 days Overall leaderboard