Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Pages - Power Apps Portals
Unanswered

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

(0) ShareShare
ReportReport
Posted on by
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?
  • Community Power Platform Member Profile Picture
    on at
    Re: How to manually redirect one step to another in webform using JavaScript

    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

  • Fubar Profile Picture
    8,001 Super User 2025 Season 1 on at
    Re: How to manually redirect one step to another in webform using JavaScript

    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?

     

  • oliver.rodrigues Profile Picture
    9,342 Most Valuable Professional on at
    Re: How to manually redirect one step to another in webform using JavaScript

    thanks for clarifying 

     

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

  • Community Power Platform Member Profile Picture
    on at
    Re: How to manually redirect one step to another in webform using JavaScript

    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,342 Most Valuable Professional on at
    Re: How to manually redirect one step to another in webform using JavaScript

    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.

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

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Pages

#1
Lucas001 Profile Picture

Lucas001 60 Super User 2025 Season 1

#2
Fubar Profile Picture

Fubar 55 Super User 2025 Season 1

#3
surya narayanan Profile Picture

surya narayanan 35