Check a box from a Notification email

  • 0
  • 1
  • Question
  • Updated 8 months ago
  • Answered
We want to check a checkbox using a link disguised as a button in a notification email. Has anyone tried such an endeavor and had success? 

My brain says it's possible and easy so if you know something my brain doesn't let me know. 

Thanks in advance. 
Photo of Jim Harrison

Jim Harrison

  • 1,770 Points 1k badge 2x thumb

Posted 8 months ago

  • 0
  • 1
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 52,786 Points 50k badge 2x thumb
That is easy to do, I think, but the issue will be permissions and even if the user does have permissions they may not be logged into Quick Base.

You could have a userid with restricted permissions, but enough to check the checkbox and the button could authenticate with a userid and password and then redirect to check the checkbox and then it would need to do something like display the record.
Photo of Jim Harrison

Jim Harrison

  • 1,770 Points 1k badge 2x thumb
Interesting behaviors: 
Here's what I have so far. I am trying it three different ways. I am testing both from the Preview window and via the email, responses are the same. 

<p>
<a href="https://<realm>/db/<dbid>?a=er&amp;r=&amp;[Record ID#]&amp;fid7=1">Click to Approve</a>
</br></br>
<a href="[Click to Approve]">Click to Approve</a>
</br></br>
Click Here: [Click to Approve]
</p>

The first one gets to the App, shows focus on the checkbox but doesn't check it.
<a href="https://<realm>/db/<dbid>?a=er&amp;r=&amp;[Record ID#]&amp;fid7=1">Click to Approve</a>

The second and third, give me a token error (An Application Token must be supplied.) when I click it using Preview or in Emails. 
var text URLONE = URLRoot() & "db/" & Dbid() & "?act=API_EditRecord&rid=" & [Record ID#]& "&_fid_7=1";
$URLONE

I removed the second variable in your recommendation because it was not encoding correctly see below. It's like Quick Base is ignoring the URLEncode function.
https://<realm>/db/<dbid>...
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 52,786 Points 50k badge 2x thumb
For now, turn off the need for application tokens.  Go to Application Properties and uncheck that box.

 or else if you want to use them you will need to create one and add in a line of code

& "&apptoken=xxxxxxxxxxxxxxxxxx"
Photo of Jim Harrison

Jim Harrison

  • 1,770 Points 1k badge 2x thumb
It's verking!
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 52,786 Points 50k badge 2x thumb
so what was the code for your final working button?
Photo of Jim Harrison

Jim Harrison

  • 1,770 Points 1k badge 2x thumb
Ah yes good point.
added a space between lines but each should be one line without newline or returns.

var text URLONE = URLRoot() & "db/" & Dbid() & "?act=API_EditRecord&rid=" & [Record ID#]& "&_fid_<Click to Approve fid>=1";

var text URLTWO = URLRoot() & "db/" & Dbid() & "?a=dr&rid=" & [Record ID#];

$URLONE & "&rdr=" & URLEncode($URLTWO) & "&apptoken=<supersecrectspecialsauce>"

Use case:
We have a form that once status changes to Submitted starts a notification process. Several users must review this form and approve. The notifications trigger off check boxes changing and checked. The user receives enough information in the email to approve the notification. This way the approval process works quickly.

Releasing it to the masses - wish me luck. 

aaaand if the user is logged out of Quick Base it doesn't work. I am thinking about the least privileges user id above. Alternatively using Workato. Hmmmm managing a Role or managing a recipe...
(Edited)