Forum Discussion
QuickBaseCoachD
8 years agoQrew Captain
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.
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.
- JimHarrison8 years agoQrew ChampionI'm getting closer.
<p>
<a href="https://<realm>/db/<dbid>?a=er&r=&[Record ID#]&fid7=1">Click to Approve</a>
</p> - QuickBaseCoachD8 years agoQrew CaptainYou 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)
- JimHarrison8 years agoQrew ChampionNope, 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. - QuickBaseCoachD8 years agoQrew CaptainSo 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. - JimHarrison8 years agoQrew ChampionInteresting 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&r=&[Record ID#]&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&r=&[Record ID#]&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>... - QuickBaseCoachD8 years agoQrew CaptainFor 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 - JimHarrison8 years agoQrew ChampionIt's verking!
- QuickBaseCoachD8 years agoQrew Captainso what was the code for your final working button?
- JimHarrison8 years agoQrew ChampionAh 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...