Discussions

 View Only
Expand all | Collapse all

Save and Redirect to a Thank You Page

  • 1.  Save and Redirect to a Thank You Page

    Posted 02-10-2019 13:39
    I am trying to allow "everyone on the internet" to update a record, save, and be redirected to a Thank You page. There is a lot of information out there about how to do this, I've tried a few version but none seem to redirect successfully. 

    I started with the code below from "ABC Customer Tracking" youtube video

    "<a class='Vibrant Success' onclick='DoSaveAdd()' href='#'><img src=\"/i/clear2x2.gif\" " &

    "onload=\"javascript:if(typeof QBU=='undefined'){QBU={};$.getScript('" &

    URLRoot() & "db/" & Dbid() & "?a=dbpage&pagename=save.js&rand='+Math.random())}\">Submit</a>"


    And tried a few options suggested in the Community

    1) URLRoot() & "db/" & Dbid() & "?a=dbpage&pageID=5"

    2) URLRoot() & "db/" & Dbid() & "?a=dbpage&pagename=ThankYou.html}\">Submit</a>"


    I am not a programmer and only good at "insert your blah blah here" so I'm struggling to adapt what I read to the base I've started with (which is probably 10 years old now?)

    Appreciate any help you can provide.  

    Thanks


  • 2.  RE: Save and Redirect to a Thank You Page

    Posted 02-10-2019 15:36
    If you were simply trying to have an anonymous user add a record and be redirected to a thank you page, then the easiest way to do this is to create a form that says thank you.

    For the everyone on the Internet role, set that form to be used for viewing records. As soon as a table has multiple forms, that will be extra savings that will appear under the forms when you can control when the app should use which form. And you will be able to set the everyone on the Internet roll to use that form for viewing.

    The effect of this is that they will be on a normal form to add their record but when they Save, they will be on a blank form which just says thank you.

    If that simple concept works for you then I can help you with a formula for a rich text field that can dress up the thank you words to make them attractive looking.


  • 3.  RE: Save and Redirect to a Thank You Page

    Posted 02-10-2019 17:31
    The first step is an email notification that includes a URL link to the form where they are asked to modify a record.  See below:

    var text URL= "https://xxx/xxx?a=er&rid="; & [Record ID#] & "&dfid=11"&"&ifv=20";"<a class=\"QBU_Button2 Vibrant Success\" href="&$URL&">"&"Confirm Ownership"&"</a>"

        [This displays as a hyperlink - can it display as a button?  I copied it and I was hoping "Button" actually meant a button]

    Once they complete this short form, this is where I'd like the customer experience to simply be a "submit" and a thank you.  The thank you can be in any form.

    The experience I'm currently getting is a message that the update has been submitted, and they return to a view of the form they just completed with the option at the top right of the screen to edit the form.

    My role has everything turned off in terms of access - with only some fields customized to allow modify.

    I'd love the help to make this as simple as possible. 

    Thanks
     



  • 4.  RE: Save and Redirect to a Thank You Page

    Posted 02-10-2019 22:34
    I do not know how to get a button appearance in an email Notification.

    But if you want to control where the user lands after saving you can use this format here

    var text URL = 
    $URLONE
    & "&NextURL=" & URLEncode($URLTWO) ;

    The above says to do URLONE and then upon save go the URLTWO.  So for you, you can set the Everyone on the Internet page to land on the Home Page as the "NextURL" upon save, except their Dashboard will be a big Rich Text element to say Thank You.




    You can have a look at this code here

    var text URLONE= URLRoot() & "db/" & Dbid() & "?a=er&rid=" & [Record ID#];
    //& "&dfid=11"&"&ifv=20";  // in my testing I commented that out
    var text URLTWO = "https://mycompany.quickbase.com/db/xxxxxx";
    var text URL = 
    $URLONE
    & "&NextURL=" & URLEncode($URLTWO);
    "<a class=\"QBU_Button2 Vibrant Success\" href=" & $URL & ">" & "Confirm Ownership" & "</a>"


  • 5.  RE: Save and Redirect to a Thank You Page

    Posted 02-13-2019 10:53
    Currently, I have a separate field for the customer link to open the form and another field for the save & redirect button.

    I tried putting all this code into one field but the redirect didn't go to my thank you page.  Perhaps this isn't all one field?  Is the URLONE the link to the form and URLTWO the save button field? 

    Thanks


  • 6.  RE: Save and Redirect to a Thank You Page

    Posted 02-13-2019 11:06
    The experience I get is that the form refreshes to a blank form.  I can fill that out and it creates orphan records. I really want just a message to return that says "thank you" and "you may close your browser" or something so my customer is successfully "terminated" from the request.

    To be honest, I'd love to be able to do that in two fields so it's easy to replicate in other apps.  That is, here's my form, here's my save. 

    Thanks again


  • 7.  RE: Save and Redirect to a Thank You Page

    Posted 02-13-2019 11:38
    The formula I provided is the hyperlink that would be in the email.  Did you try my formula?


  • 8.  RE: Save and Redirect to a Thank You Page

    Posted 02-13-2019 11:47
    I did.  This is what I have.

    var text URLONE= URLRoot() & "db/" & Dbid() & "?a=er&rid=" & [Record ID#] & "&dfid=11"&"&ifv=20"; 
    var text URLTWO = "https://my_domain/db/my_db?a=er&rid=";
    var text URL =
    $URLONE
    & "&NextURL=" & URLEncode($URLTWO) ;
    "<a class=\"QBU_Button2 Vibrant Success\" href=" & $URL & ">" & "Confirm Ownership" & "</a>"




  • 9.  RE: Save and Redirect to a Thank You Page

    Posted 02-13-2019 11:53
    But that is not my formula. 

    The first URLONE is to edit the record.  The second URLTWO is to display the home page of he app where there would be a thank you message.

    Try fixing your URLTWO


  • 10.  RE: Save and Redirect to a Thank You Page

    Posted 02-13-2019 12:07
    Sorry, very confused. I'm not a programmer. The first part works fine - I get the form, no quickbase bling or confusing extra save button.  Perfect.

    All I need is a "new" save button that doesn't allow my users additional access to edit the database and simply says good bye.

    Is that possible? 

    Thanks again for your help.



  • 11.  RE: Save and Redirect to a Thank You Page

    Posted 02-13-2019 12:31
    I will post code when I get the office. On the ipad the code won�t post.


  • 12.  RE: Save and Redirect to a Thank You Page

    Posted 02-13-2019 13:27
    I think what you are saying is that you wanted to use the &ifv=20 to get rid of the "Quick Base bling" and now you do not have a SAVE button because it was lost with the rest of the "bling".

    Here is some code for a Formula Rich Text field type to make your own SAVE button and label it how you like.

    "<a id='saveButton' class='Vibrant Success' onclick='DoSave()' href='#'>WhatEverYouWantYourButtonToSay</a>"



  • 13.  RE: Save and Redirect to a Thank You Page

    Posted 02-13-2019 18:38

    The experience I receive is that the form converts to a new form, which a customer can mis-interpret as they need to fill it out again, if they do, this saves an orphan record.  See attached screen print.

    Based on that YouTube video, you should be able to do this... I copied the code directly from the free app - just trying to make it work. I only want to replicate what I see in that example.

    I don't want to see a copy of the form, I don't want them to be able to edit the form.  They are done. When I hit the "custom" save button, the only thing that I want to return to the customer is "Thank you." 

    Perhaps I'm not explaining my requirement very well. But the code from the ABC Customer Tracker app is:


    "<a class='Vibrant Success' onclick='DoSaveAdd()' href='#'><img src=\"/i/clear2x2.gif\" " &
    "onload=\"javascript:if(typeof QBU=='undefined'){QBU={};$.getScript('" &
    URLRoot() & "db/" & Dbid() & "?a=dbpage&pagename=save.js&rand='+Math.random())}\">Submit</a>"

    //This button changes the Document Object Model (DOM) of the page.
    //This button uses a variation of Dan Diebolt's image unload technique to load a dbpage called save.js.  This page changes the redirect URL to a thankyou.html page.
    //QuickBase reserves the right to change it's code at any time without notice.  A code change could render this technique inoperable.
    //If this button is visible on the page this will force the regular Save button to redirect as well.

    I've created the "save.js" page.. this just doesn't work for me.

    Thanks



  • 14.  RE: Save and Redirect to a Thank You Page

    Posted 02-13-2019 19:58
    I cannot help you with the code i did not supply.  You may want to contact me directly for one on one assistance.

    QuickBaseCoach.com


  • 15.  RE: Save and Redirect to a Thank You Page

    Posted 02-13-2019 23:27
    Hi Anne.

    I recently did exactly what you are looking to do without any code.

    Click Settings from your application's Home page and under User Interface click on the "+New" button to create a page specific for the Everyone on the Internet (EOTI) role that you created with access to the table where the records will be added.  Add any text instructions you wish and a New button specifying that table.  After saving this first page, add a second page of the rich text type named "Thank you" with any text you wish and save it.

    Go back and edit the first page and click the right side of the "new record" button that you created earlier and then click on the wrench icon appearing on the right side of the button.  You will see a field called "After saving the new record" - select the option "Go to another page."  In the next field, select the "Thank you" page.

    Let me know if you have any questions.

    Mark Levitt
    Product Marketing, Quick Base


  • 16.  RE: Save and Redirect to a Thank You Page

    Posted 02-14-2019 12:59
    Mark, this seems like a great solution when the user is being asked to create a new record.

    But in this use case the requirement seems to be to edit a specific record, based on receiving a link by email, and then redirect to a thank you page.


  • 17.  RE: Save and Redirect to a Thank You Page

    Posted 02-14-2019 13:26
    Good point. Thanks.
    Mark


  • 18.  RE: Save and Redirect to a Thank You Page

    Posted 02-27-2019 20:50

    I reached out to Kirk Trachy at quickbase and he was able to solve my problem.  In my "save.js" page, I was redirecting based on adding a new record when in fact I was editing an existing record.  So, this code for the save.js page will do both.

    Thanks again for all your help in trying to solve this problem - greatly appreciated!


    (function(){
      var querystring=document.location.search;

      if (/nwr/i.test(querystring)) {

        $("#RedirectURL").val(gReqAppDBID+'?a=dbpage&pagename=ThankYou.html&ifv=20');
        $("input[name=rl]").val("");

      }

     else if(/a=er/i.test(querystring)) {
      
    $("#RedirectURL").val(gReqAppDBID+'?a=dbpage&pagename=ThankYou.html&ifv=20');
        $("input[name=rl]").val("");
     
      }

    })();

    //This page is loaded automatically by using a variation of Dan Diebolt's image unload technique where a transparent image
    //located within the "Submit" button field is displayed thus pulling this page.
    //The if test above only will change the RedirectURL if nwr is contained within the URL.