Discussions

Expand all | Collapse all

Confirmation button in email

Lochlan Broughton07-28-2017 00:20

  • 1.  Confirmation button in email

    Posted 06-20-2017 00:41
    We have designed a HTML 'Booking Ticket' email to be sent as an email notification to clients when booking details are received.

    The email notification is sent to the client directly via Quickbase notify upon saving the form.

    We would like to include a button in the email which the client presses that 'confirms' the booking.

    How would we go about building this button that changes the 'job status' field in a job row to 'confirmed'?


  • 2.  RE: Confirmation button in email

    Posted 06-22-2017 14:33
    create a formula field with the below formula 

    URLRoot() & "db/" & Dbid()  & "?a=API_EditRecord&usertoken=USER_TOKENrid="&[Record ID#]&"&_fid_18=approved"

    _fid_18 - change to your fid

    and on the notification 

    Message Type : Custom Message
    Custom Message: [Formula_field]
    Interpret Custom Message as HTML: Yes


  • 3.  RE: Confirmation button in email

    Posted 07-28-2017 06:58
    Do you know any way to redirect the user to another URL after changing the field?


  • 4.  RE: Confirmation button in email

    Silver
    Contributor
    Posted 07-28-2017 07:00
    Can you post another URL? then, will format the formula for you.


  • 5.  RE: Confirmation button in email

    Posted 07-28-2017 07:01
    We're still building the website, so for now could you use www.example.com?


  • 6.  RE: Confirmation button in email

    Silver
    Contributor
    Posted 07-28-2017 07:41
    Try to add at the end of URL:

    & "&rdr=" & URLEncode("http://www.google.com")


  • 7.  RE: Confirmation button in email

    Posted 07-31-2017 01:27
    Thank you! Do you have any advice or best practices for hiding the user token from users? Or do you just fine-tune the permissions so that particular user token can only edit particular fields, and not view tables?


  • 8.  RE: Confirmation button in email

    Posted 07-28-2017 00:20
    Amazing. Thank you.


  • 9.  RE: Confirmation button in email

    Posted 10-27-2018 05:41
    Have been trying to get this to work, but it is not working for me i am using application tokens. here is my formula url 

    URLRoot() & "db/" & Dbid()  & "?a=API_EditRecord&usertoken=xxxxxxx&apptoken=xxxxxxxrid="&[Record ID#]&"&_fid_143=1"

    i am getting an error saying that application token are required. 


  • 10.  RE: Confirmation button in email

    Posted 23 days ago
    I stumbled across this post trying to accomplish the same thing. I'm also getting an error 24 with the app token. I can't understand why as I'm using the token with another API currently. I can't get anywhere with this until I solve the token issue.

    ------------------------------
    Chris Newsome
    ------------------------------



  • 11.  RE: Confirmation button in email

    Posted 23 days ago
    Please post you code that is now working.

    ------------------------------
    Mark Shnier (YQC)
    markshnier2@gmail.com
    ------------------------------



  • 12.  RE: Confirmation button in email

    Posted 20 days ago
    Field type is Formula-URL

    URLRoot() & "db/" & Dbid() & "?a=API_EditRecord&rid=URLEncode([Record ID#])&apptoken=XXXXXX&_fid_202=Checked"

    I'm trying to send a confirmation email to a customer with a "confirm" button that will switch a checkbox to checked when they click it.

    Thanks!

    ------------------------------
    Chris Newsome
    ------------------------------



  • 13.  RE: Confirmation button in email

    Posted 20 days ago
    The response I get every time is Error 24.

    ------------------------------
    Chris Newsome
    ------------------------------



  • 14.  RE: Confirmation button in email

    Posted 20 days ago
    This is the correct syntax to check a checkbox


    &_fid_202=1"




    ------------------------------
    Mark Shnier (YQC)
    markshnier2@gmail.com
    ------------------------------



  • 15.  RE: Confirmation button in email

    Posted 20 days ago
    will that solve the error 24?

    ------------------------------
    Chris Newsome
    ------------------------------



  • 16.  RE: Confirmation button in email

    Posted 20 days ago
    I doubt that it is an error message and its hard to respond  if you do not post the complete "error message"  My guess is that is in fact a success message.

    When you use an API you need to either redirect to another page after the API or refresh the page or else the success message will appear on the screen which will look like an error message.

    One syntax is this

    var text URL = 

    URLRoot() & "db/" & Dbid() & "?a=API_EditRecord&rid=URLEncode([Record ID#])&apptoken=XXXXXX&_fid_202=1";

    "javascript:" &
    "$.get('" &
    $URL &
    "',function(){" &
    "location.reload(true);" &
    "});"
    & "void(0);"

    That syntax will run the URL and refresh the page.

    I also have an app in the Exchange called URL formuals for Dummies which has another way to suppress the XML success response.

    ------------------------------
    Mark Shnier (YQC)
    markshnier2@gmail.com
    ------------------------------



  • 17.  RE: Confirmation button in email

    Posted 20 days ago
    <qdbapi>
    <action>API_EditRecord</action>
    <errcode>24</errcode>
    <errtext>Invalid Application Token</errtext>
    <errdetail>An Application Token must be supplied.</errdetail>
    </qdbapi>


    ------------------------------
    Chris Newsome
    ------------------------------



  • 18.  RE: Confirmation button in email

    Posted 20 days ago
    this is with my original formula (modified with the "1" at the end)

    ------------------------------
    Chris Newsome
    ------------------------------



  • 19.  RE: Confirmation button in email

    Posted 20 days ago
    I tried your formula and got a blank pop-up that stayed open. The box did not get checked.

    ------------------------------
    Chris Newsome
    ------------------------------



  • 20.  RE: Confirmation button in email

    Posted 20 days ago
    Can you post your actual code (you can xxxx out the app token if you like).

    ------------------------------
    Mark Shnier (YQC)
    markshnier2@gmail.com
    ------------------------------



  • 21.  RE: Confirmation button in email

    Posted 20 days ago
    In the App Properties section you set if you want to use Application Tokens.  This is an extra layer of security which you may not need.  So either you need to turn off that need for Application Tokens or else go into Manage Application Tokens and supply a valid one into the formula.  "xxxxx' is not a valid application token.

    ------------------------------
    Mark Shnier (YQC)
    markshnier2@gmail.com
    ------------------------------



  • 22.  RE: Confirmation button in email

    Posted 20 days ago
    the original formula was up at #12 above...

    App tokens are turned on in my app already, I'm already using them for other functions.
    I just changed the actual token to XXXX for the purpose of posting here.


    ------------------------------
    Chris Newsome
    ------------------------------



  • 23.  RE: Confirmation button in email

    Posted 20 days ago
    var text URL =

    URLRoot() & "db/" & Dbid() & "?a=API_EditRecord&rid=URLEncode([Record ID#])&apptoken=cwfcy7gdzqrsyncqbi2bn4u4kr&_fid_202=1";

    "javascript:" &
    "$.get('" &
    $URL &
    "',function(){" &
    "location.reload(true);" &
    "});"
    & "void(0);"

    ------------------------------
    Chris Newsome
    ------------------------------



  • 24.  RE: Confirmation button in email

    Posted 20 days ago
    1. Can you tell me what happens when you click that button?

    2. Can you tell me what happens when you just run the URL , I want to see if there are any error messages.

    The revised code to just run the URL without refreshing the page would be

    var text URL =

    URLRoot() & "db/" & Dbid() & "?a=API_EditRecord&rid=URLEncode([Record ID#])&apptoken=cwfcy7gdzqrsyncqbi2bn4u4kr&_fid_202=1";

    $URL

    ------------------------------
    Mark Shnier (YQC)
    markshnier2@gmail.com
    ------------------------------



  • 25.  RE: Confirmation button in email

    Posted 20 days ago
    1. sure - with your code previously, it popped open a new window that stayed blank. nothing else happens. With my code, it generates the error message.
    2. i tried copy / paste in a new browser window with the URL, same result as #1
    3. With the new code you just gave me, I get the error screen: (nothing else happens)

    This XML file does not appear to have any style information associated with it. The document tree is shown below.
    <qdbapi>
    <action>API_EditRecord</action>
    <errcode>24</errcode>
    <errtext>Invalid Application Token</errtext>
    <errdetail>An Application Token must be supplied.</errdetail>
    </qdbapi>


    ------------------------------
    Chris Newsome
    ------------------------------



  • 26.  RE: Confirmation button in email

    Posted 20 days ago
    I have 2 application tokens created in my app. I have tried using both as the token in this formula. I am using one successfully now with a web contact form API.

    ------------------------------
    Chris Newsome
    ------------------------------



  • 27.  RE: Confirmation button in email

    Posted 20 days ago
    The app token must be invalid.  Maybe it was not copy and pasted correctly.  Note that an Application Token is not the same thing as a User Token.

    ------------------------------
    Mark Shnier (YQC)
    markshnier2@gmail.com
    ------------------------------



  • 28.  RE: Confirmation button in email

    Posted 20 days ago
    it's an app token, not a user token. That was actually the first thing I considered, but I've quadruple checked that it's correct, I even just copy / pasted the string. What could be wrong? This is so frustrating.

    ------------------------------
    Chris Newsome
    ------------------------------



  • 29.  RE: Confirmation button in email

    Silver
    Contributor
    Posted 20 days ago
    Try a) switching your formula around and b) using both an apptoken and a usertoken.  I have done this; and I use both and it works.


    URLRoot() & "db/" & Dbid() & "?a=API_EditRecord&apptoken=cwfcy7gdzqrsyncqbi2bn4u4kr&usertoken=xyz123455678&rid=" & [Record ID#]
    & "&_fid_202=1";

    ------------------------------
    Laura Thacker (IDS)
    laura@intelligentdbs.com
    (626) 771 0454
    ------------------------------



  • 30.  RE: Confirmation button in email

    Posted 20 days ago
    OK this worked to check the box!! It did pull up a screen that told me what happened though:

    This XML file does not appear to have any style information associated with it. The document tree is shown below.
    <qdbapi>
    <action>API_EditRecord</action>
    <errcode>0</errcode>
    <errtext>No error</errtext>
    <rid>26154</rid>
    <num_fields_changed>1</num_fields_changed>
    <update_id>1566843038819</update_id>
    </qdbapi>

    Any idea how to make it (from a customer's perspective) so that they click the button and it redirects to a webpage? I don't want them seeing any screens from Qbase.

    ------------------------------
    Chris Newsome
    ------------------------------



  • 31.  RE: Confirmation button in email

    Posted 20 days ago
    And then I need to put that in a system generated email to the customer.

    ------------------------------
    Chris Newsome
    ------------------------------



  • 32.  RE: Confirmation button in email

    Posted 20 days ago
    I can post back with a suggestion on that later in the day. I.e. how to read direct to a webpage.

    ------------------------------
    Mark Shnier (YQC)
    markshnier2@gmail.com
    ------------------------------



  • 33.  RE: Confirmation button in email

    Silver
    Contributor
    Posted 20 days ago
    URLRoot() & "db/" & Dbid() & "?a=API_EditRecord&apptoken=cwfcy7gdzqrsyncqbi2bn4u4kr&usertoken=xyz123455678&rid=" & [Record ID#]
    & "&_fid_202=1"
    & "&rdr=" & URLEncode(
    "https://xxxx");


    ------------------------------
    Laura Thacker (IDS)
    laura@intelligentdbs.com
    (626) 771 0454
    ------------------------------



  • 34.  RE: Confirmation button in email

    Posted 20 days ago
    If you have any problem redirecting to an external website, you may have to contact Quickbase Support and ask them to enable your realm to allow redirect to extra websites. I had that problem once and it drove me crazy.

    ------------------------------
    Mark Shnier (YQC)
    markshnier2@gmail.com
    ------------------------------



  • 35.  RE: Confirmation button in email

    Posted 20 days ago
    Redirect worked great! Thanks to both Mark and Laura on this. 

    When I go to pop it into an email notification, is there something special I need to do there?

    ------------------------------
    Chris Newsome
    ------------------------------



  • 36.  RE: Confirmation button in email

    Silver
    Contributor
    Posted 20 days ago
    No, you use it like a regular field; but it will show up as a link not a button, no matter whether you have set it to display as a button or not.  Make sure the Link Text makes sense for what it is going to do.

    ------------------------------
    Laura Thacker (IDS)
    laura@intelligentdbs.com
    (626) 771 0454
    ------------------------------