How do you create an approval button within Email Notifications?

  • 0
  • 1
  • Question
  • Updated 6 days ago
  • Answered
I setup the following in a formula URL field:

URLRoot() & "db/" & Dbid() & "?act=API_EditRecord&apptoken=<App Token>&_fid_224=Approved&rid=" & [Record ID#]

When it runs it gives me a link.
My users are asking for a html button.
Is this possible?

The other issue is that when submitting this link the system responds with a XML response.
I'd really like to give them a human readable text response.
Any ideas on this?
Photo of Lawrence Clink

Lawrence Clink

  • 190 Points 100 badge 2x thumb

Posted 7 months ago

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

QuickBaseCoach App Dev./Training, Champion

  • 51,546 Points 50k badge 2x thumb
This syntax will probably work

var bool NewToggle = not [Completed?];

var text Update = URLRoot() & "db/" & Dbid() & "?act=API_EditRecord&rid=" & [Record ID#]
& "&_fid_6=" & $NewToggle;

var text Words = [Account Name];

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

"
Photo of Lawrence Clink

Lawrence Clink

  • 190 Points 100 badge 2x thumb

Thank you for the quick response.
I believe your answer assumes a level of understanding that I do not have.
I assume you are answering the part of my question to do with the XML response.
I'm not quite sure what to do with the code you sent.
You are referencing a fid of 6 (a boolean) which I assume I must modify to fit what I have in my table.
I can create a new field type boolean if needed.

Here's what I have:

Table: Projects

Field 224: Project Approval
Type: text

Field 225: Project Approval Button
Type: Formula - URL
Formula: URLRoot() & "db/" & Dbid() & "?act=API_EditRecord&apptoken=<App Token>&_fid_224=Approved&rid=" & [Record ID#]

Notification: Project Completion Approval
Condition: Sent wherever field "Status" changes to "Completed"
Type: Custom Message
Custom Message:

Hello User,<br>
Please approve the project [Project Name] using the below approval link.<br><br>

[Project Approval Button]
<br><br>
Thank you for your attention,<br><br>
MEDA QuickBase Administration


I have 2 issues.

1. Email is sent with a link (it works in that it updates the Project Approval with "Approved").
   Need to modify to send with a button as requested from the users.

2. Once the link is submitted a browser session is started with a XML response.
   Need to provide a human readable response. These are business users and would not understand XML.

Please let me know if any further information is needed.

Thanks.
 

Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 51,546 Points 50k badge 2x thumb
Try making a formula URL field and puttng it in your email notification.

var text URLONE = URLRoot() & "db/" & Dbid() & "?act=API_EditRecord&apptoken=<App Token>&_fid_224=Approved&rid=" & [Record ID#];

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

$URLONE
& "&rdr=" & URLEncode($URLTWO)
Photo of Jim Harrison

Jim Harrison

  • 1,770 Points 1k badge 2x thumb

Use the information below to put a link into a Notification email.

This works on a PC or Mobile device. It also works if a user is logged in or not.


The link is Used to respond to a Notification by changing a status, checking a checkbox, or other interactions that require a response. The example below clicks a checkbox.

 

The link goes into a text field on the table:

var text URLONE = URLRoot()& "db/" & Dbid()& "?act=API_EditRecord&rid="& [Record ID#]& "&_fid_<field ID>=1"& "&apptoken=<apptoken>"& "&usertoken=<usertoken>";

var text URLTWO = URLRoot();

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

 

Then the field is added to a custom email Notification:

<a href="[Click to Approve]">Click to Approve</a>

 

Improvements:

Once the User clicks the link, the browser opens and takes the user to the QB login page. We would like to remove this unnecessary step. QB requires the User login to the App and load the page.

To make the link into a button you must use the img tag. https://www.w3schools.com/css/css3_buttons.asp Use this tutorial to learn how to do this.

Your button image can be one of the images stored here: https://login.quickbase.com/db/bcgnn27bx?a=q&qid=1000039
Photo of Lawrence Clink

Lawrence Clink

  • 190 Points 100 badge 2x thumb
So then how do you get the notification to turn the {<a href="[Click to Approve]">Click to Approve</a>} into a button?
Photo of Jim Harrison

Jim Harrison

  • 1,768 Points 1k badge 2x thumb
Funny, I thought about it this morning and realized that without an attachment the img tag appears as html text.

Unless someone else has ideas, this looks like a UserVoice ticket and we gather a mob to vote it into reality. 
Photo of Lisa

Lisa

  • 210 Points 100 badge 2x thumb
In the Exchange, you can get Kirk Trachy's 'ABC Customer Approval Tracker", and you can watch his how-to video https://www.youtube.com/embed/zfKkktE0dzM
Photo of Jim Harrison

Jim Harrison

  • 1,768 Points 1k badge 2x thumb
Lisa, can you tell me what happens if the user has an account with Quickbase? While this video describes if the user doesn't have a quickbase account, we are interested in using this for both quickbase users and non-quickbase users. Can you speak from experience  before going through the trouble of building? 

Thanks
Photo of Lisa

Lisa

  • 210 Points 100 badge 2x thumb
Unfortunately we only used this button in an email feature once, and it was for the Everyone on the Internet role. Sorry I can't be of more help, but there seem to be more related conversations here in the forum - I'm sure someone has done this
Photo of Nicole Cicala

Nicole Cicala

  • 70 Points
I followed this and when sent to an external user cannot get the html page to load.  Its saying that we need to log in.  Did you experience the same issue?
Photo of Lawrence Clink

Lawrence Clink

  • 190 Points 100 badge 2x thumb

That really helped.

It gives me the code I needed for the button I was looking for.

Thanks so much!

Photo of Paul Vorster

Paul Vorster

  • 556 Points 500 badge 2x thumb
100% Agreed Lawrence, it is working for me as well.  I am just stuck on the login page now, and need to figure out how to redirect to the exact table, as the user is an existing Quickbase User.