We have a low tech solution which is certainly doable and practical, but not as elegant as a pop up.
Make a button which simply displays the same record on a super mini form. The form will have a very few bare bones fields to identify the record and then two buttons.
then a message saying "Are you sure that you want to .... whatever "like start a nuclear Armageddon" or in your case . "Send out Candidate emails".
One button might be red called CANCEL! That would just redisplay the original record on the full form. The other button would do the API and land the user back on the full form.
So basically not a pop up but just making the user do an extra click to get to an alternate form to send the email.
------------------------------
Mark Shnier (YQC)
mark.shnier@gmail.com------------------------------
Original Message:
Sent: 08-20-2021 18:47
From: Devin Jackson
Subject: Confirm Popup and if "OK"" execute API
I am looking to create a Pop-Up that requests a confirmation before an action is taken.
I created a button that toggles a box to initiate a notification send out to our Candidates (code below). This works great.
var number newToggleValue = If([test_box]=true,0,1);
var text urlOne = URLRoot() & "db/" & Dbid()
& "?act=API_EditRecord&rid=" & [Record ID#]
& "&_fid_28=" & $newToggleValue
& "&apptoken=XXXXXXX";
var text urlTwo = URLRoot() & "db/" & Dbid() & "?a=dr&rid=" & [Record ID#];
$urlOne
& "&rdr=" & URLEncode($URLTWO)
_____________________________
But I would like to have the button request confirmation that the user wanted to press the button. So we don't send out emails accidentally.
Something like:
If button is pressed, display "Are you sure you want to send notification?" with options "Send" and "Cancel".
If Send, $urlOne & "&rdr=" & URLEncode($URLTWO)
If Cancel, do nothing and close popup.
All resources I have found on this discuss using Javascript in a URL Formula Field back in 2019, and I know QuickBase does not take Javascript atm, whether it did in the past I do not know. Any thoughts on how to accomplish this now?
------------------------------
Devin Jackson
Director of Operations
MedMatch
------------------------------