Skip to main content


Button actions delay



  • AndrewBerezovskyy2

    Hello Manuel Habert


    For this 

    • The problem is, that I need to authenticate on a popup. During this authentication the other two actions (Save and Redirect) already start.
      Is there a possibility to wait until my custom code is finished?

    you can use next approach:


    In you code you will add next line: (window.O365GroupCreated = true)

    function createOffice365Group(token) {
            type: "POST",
            url: "",
            headers: {
                "Authorization": "Bearer " + token,
                "Content-Type": "application/json"
            data: group,
            }).done(function (response) {
    window.O365GroupCreated = true;
                console.log("Successfully created group.");
            }).fail(function () {
                console.log("Creating group failed.");


    Then you must delete redirect action and add form load action which will continuously check whether group was created and if it was created than redirect to your url . Code will looks like:

    var redirectUrl = ... // can be formed using placeholders

    //check each 1 sec
    function checkWhetherO365GroupExist(){
        // do whatever you like here
              window.loacation.href = redirectUrl ;
        setTimeout(checkWhetherO365GroupExist, 1000);
         // Also you can stop checking using some timeout



    • Is it possible to edit the current SharePoint item with the result of REST call?

    Yes. For example you can add button with action. Than you must add action with  type execute code where you will perform your REST call. You REST call will return some value and then you can programatically update listitem . How to do this you can find here


    Kind Regards
    Andriy Berezovsky

  • ManuelH

    Hi Andrew Berezovskyy


    Thanks for your reply.

    Both could solve my problems. I deleted the save and redirect actions and I'm doing everything in my JavaScript.


    Best Regards

    Manuel Habert


Please sign in to leave a comment.