create a button that will trigger email notification

  • 1
  • 4
  • Question
  • Updated 12 months ago
  • Answered

I show the example below in an earlier post but I can't get it to work


URLRoot() & "db/" & Dbid() & "?a=API_EditRecord&rid=" & [Record ID#] & "_fid_208=1"&"\n&rdr=" & URLEncode(URLRoot() & "db/" & Dbid() & "?a=dr&rid=" & [Record ID#])

Photo of Shontay

Shontay

  • 490 Points 250 badge 2x thumb

Posted 3 years ago

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

QuickBaseCoach App Dev./Training, Champion

  • 62,994 Points 50k badge 2x thumb
There seem to be some extra characters in the middle.  The \n does not belong and you were missing an &



URLRoot() & "db/" & Dbid() & "?act=API_EditRecord&rid=" & [Record ID#] 

& "&_fid_208=1" 

& "&rdr=" & URLEncode(URLRoot() & "db/" & Dbid() & "?a=dr&rid=" & [Record ID#])
Photo of Shontay

Shontay

  • 490 Points 250 badge 2x thumb
Do I need the apptoken?

Below is what I have and I am receiving an error message:

URLRoot() & "db/" & Dbid() & "?a=API_EditRecord&apptoken=kn75dwb4y6nhrdtb89z2cnv9ay4" & [Record ID#] &"& _fid_208=1"&"&rdr=" & URLEncode(URLRoot() & "db/" & Dbid() & "?a=dr&rid=" & [Record ID#])
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 62,994 Points 50k badge 2x thumb
I suggest that you go into Settings and then Application Properties and uncheck the box which requires application tokens.

Then i suggest that you review the formula which I posted and use it instead of your formula.  You formula is missing the &rid= part which tells the formula which record ID to update.
Photo of Shontay

Shontay

  • 490 Points 250 badge 2x thumb
The App token have to be required, so would I apply that right after the EditRecord& apptoken =???"
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 62,994 Points 50k badge 2x thumb
It would look like this with an app token

URLRoot() & "db/" & Dbid() & "?act=API_EditRecord&rid=" & [Record ID#]
& "&apptoken=kn75dwb4y6nhrdtb89z2cnv9ay4"
& "&_fid_208=1"
& "&rdr=" & URLEncode(URLRoot() & "db/" & Dbid() & "?a=dr&rid=" & [Record ID#])
Photo of Shontay

Shontay

  • 490 Points 250 badge 2x thumb
thanks I got it to work
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 62,994 Points 50k badge 2x thumb
thx for letting me know.  now, btw, after the button is pushed, then if it is pushed again, the email will not fire as the trigger field is already set to 1 (true).  If you want it to fire every time and you tell me what the name is of your trigger field that field ID 208, then I can help you with that.
Photo of Shontay

Shontay

  • 490 Points 250 badge 2x thumb
thanks you read my mind the field name is Send_Notification
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 62,994 Points 50k badge 2x thumb
var text NewToggle = IF([Send_Notification] = true, "0","1") // this will make the toggle be the opposite of its current value, but in text format.


URLRoot() & "db/" & Dbid() & "?act=API_EditRecord&rid=" & [Record ID#]
& "&apptoken=kn75dwb4y6nhrdtb89z2cnv9ay4"
& "&_fid_208=" & $NewToggle
& "&rdr=" & URLEncode(URLRoot() & "db/" & Dbid() & "?a=dr&rid=" & [Record ID#])
Photo of Shontay

Shontay

  • 490 Points 250 badge 2x thumb
Perfect you rock, thanks alot
Photo of Michael

Michael

  • 32 Points
What if I want to send out an entire report, like a report I'm subscribed to daily, but on demand at the click of a button. I suppose I could use the api but the report subscription is working like I like it I just may need it more than daily.
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 62,994 Points 50k badge 2x thumb
If you are the Admin, you can go to the Subscription setup page and click the button to send out a test Subscription.,  That basically forces out the Subscription at will.  It does take a few minutes to get though the queue and get processes.

If you want to make a URL formula button to force out a Subscription, you can mimic the URL that you see when you click that button.

URLRoot() & "db/" & [_DBID_TABLE_NAME_GOES_HERE] & "?a=SendSubscription&ID=XX"
Replace XX with the Subscription number you see in the URL when working with the Subscription.
Photo of Ursula Ll

Ursula Ll

  • 1,504 Points 1k badge 2x thumb
What do you mean "go through the queue"? I ask because I have a email that triggers if a particular button is checked. Last night the records were all checked at around 10:30, but the emails did not go out until 11:07 pm. No other emails were sent out, so I am curious what the queue would have had that could have held up those emails. 
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 62,994 Points 50k badge 2x thumb
Are you talking about a button which forces out a Subscription?  like .... & "?a=SendSubscriptin&ID=1
Photo of Ursula Ll

Ursula Ll

  • 1,504 Points 1k badge 2x thumb
nope, i mean just a simple email notification trigger on a checkbox. I actually did some research on the emails. Turns out it was stuck in the SparkPost queue, not the Quickbase queue. Never happened before, so it was very strange.