Skip to main content
Question

Save and Redirect to a Thank You Page

  • February 10, 2019
  • 0 replies
  • 80 views

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
This topic has been closed for replies.

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.

  • Author
  • Registered
  • February 10, 2019
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
 


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>"

  • Author
  • Registered
  • February 13, 2019
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

  • Author
  • Registered
  • February 13, 2019
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

The formula I provided is the hyperlink that would be in the email.  Did you try my formula?

  • Author
  • Registered
  • February 13, 2019
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>"



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

  • Author
  • Registered
  • February 13, 2019
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.


  • Registered
  • February 14, 2019
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

  • Author
  • Registered
  • February 28, 2019

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.