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 : SS7uCHktTyqyRnKHmxWpo6
Power Pages - Power Apps Portals
Unanswered

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

Like (0) ShareShare
ReportReport
Posted on 13 Oct 2020 12:35:06 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?
I have the same question (0)
  • Community Power Platform Member Profile Picture
    on 21 Dec 2020 at 02:05:31
    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,085 Super User 2025 Season 2 on 18 Oct 2020 at 22:32:20
    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,347 Most Valuable Professional on 14 Oct 2020 at 07:28:47
    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 14 Oct 2020 at 01:26:00
    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,347 Most Valuable Professional on 13 Oct 2020 at 21:08:17
    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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

MS.Ragavendar – Community Spotlight

We are honored to recognize Ragavendar Swaminatha Subramanian as our September…

Leaderboard > Power Pages

#1
Jon Unzueta Profile Picture

Jon Unzueta 107 Super User 2025 Season 2

#2
KevinGador Profile Picture

KevinGador 34 Super User 2025 Season 2

#3
SwatiSTW Profile Picture

SwatiSTW 24 Super User 2025 Season 2

Last 30 days Overall leaderboard
Loading complete