Discussions

Expand all | Collapse all

Check a box from a Notification email

  • 1.  Check a box from a Notification email

    Posted 04-03-2018 19:14
    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. 


  • 2.  RE: Check a box from a Notification email

    Posted 04-03-2018 21:59
    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.


  • 3.  RE: Check a box from a Notification email

    Posted 04-03-2018 22:27
    I'm getting closer.

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


  • 4.  RE: Check a box from a Notification email

    Posted 04-03-2018 22:49
    You can just use a formula URL field then.

    The field will be called [Click to Approve]

    But then what do you want to happen in terms of the user interface when the button is clicked.  Should it display the record?



    var text URLONE = URLRoot() & "db/" & dbid()
    & "?act=API_EditRecord&rid=" & [Record ID#]
    & "&_fid_7=1";

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


    $URLONE
    & "&rdr=" & URLEncode($URLTWO)





     


  • 5.  RE: Check a box from a Notification email

    Posted 04-04-2018 14:10
    Nope, just check the box. Doesn't need to display anything. 

    Thanks for the above, I was hoping to grab the dbid and realm data in the email but noticed it doesn't work that way. Making it into a field and then placing the field into the email makes more sense.


  • 6.  RE: Check a box from a Notification email

    Posted 04-04-2018 15:15
    So the issue will be that when the API run to check the box if you do not do something next it will likely spill some xml success message code back to the user. 

    But I have not actually tested what happens when clicking from an email.


  • 7.  RE: Check a box from a Notification email

    Posted 04-04-2018 15:40
    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>...


  • 8.  RE: Check a box from a Notification email

    Posted 04-04-2018 15:51
    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


  • 9.  RE: Check a box from a Notification email

    Posted 04-04-2018 18:47
    It's verking!


  • 10.  RE: Check a box from a Notification email

    Posted 04-04-2018 18:48
    so what was the code for your final working button?


  • 11.  RE: Check a box from a Notification email

    Posted 04-04-2018 19:23
    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...