URL formula redirect

  • 0
  • 1
  • Question
  • Updated 4 years ago
  • Answered

I am trying to write a URL formula that will be put into a Email notification as a button. When someone clicks this button i want it to change a status and date stamp a field. I have figured out the date stamp and status change but i can not figure out the redirect. 

I want the formula to make the changes to the record and then redirect the user to the changed record in a view mode. 

Here is what i have so far...

URLRoot() & "db/" & Dbid() & "?a=API_EditRecord&apptoken=caaaaaaaaaaaaaaaaaaaa &rid=" & URLEncode ([Record ID#])


& "&_fid_85=Posted"


& "&_fid_86=" & URLEncode(Now())


& "&rdr=" & URLEncode(URLRoot() & URLEncode ([Record ID#]))


when i run this formula i get a 404 not found error.

Any help would be greatly appreciated!

Thanks! 

Photo of Conner

Conner

  • 40 Points

Posted 4 years ago

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

QuickBaseCoach App Dev./Training, Champion

  • 67,278 Points 50k badge 2x thumb
The redirect URL destination is missing a bunch of code.

 "&rdr=" & URLEncode(
URLRoot() & "db/" & dbid() & "a=dr&rid=" & ToText ([Record ID#])
)
Photo of Conner

Conner

  • 40 Points
hmmm, i added that line of code to the end and i now get a page from quickbase that says "there's nothing there"...any suggestions? This is what i currently have.

URLRoot() & "db/" & Dbid() & "?a=API_EditRecord&apptoken=aaaaaaaaaaaaaaaaaaaaaaaaaa &rid=" & URLEncode ([Record ID#])

& "&_fid_85=Posted"

& "&_fid_86=" & URLEncode(Now())

&"&rdr=" & URLEncode(
URLRoot() & "db/" & Dbid() & "a=dr&rid=" & ToText ([Record ID#])
)
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 67,278 Points 50k badge 2x thumb
Sorry. My mistake. In that last redirect we need a ? before the  a=dr&rid

 "?a=dr&rid=     ........
Photo of Conner

Conner

  • 40 Points
Perfect! Thanks for your help!
Photo of Conner

Conner

  • 40 Points
URLRoot() & "db/" & Dbid() & "?a=API_EditRecord&apptoken=civg49mbe8mfinck233i2cfquiga &rid=" & URLEncode ([Record ID#])

& "&_fid_85=Posted"

& "&_fid_86=" & URLEncode(Now())

& "&_fid_109=" & URLEncode(User())

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

this is my formula but for some reason when anyone clicks on the link from their email the time stamp for the "now" action is stamping at the date of creation.

any ideas?

when i use the button within quickbase it timestamps correctly only when its clicked from the email.
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 67,278 Points 50k badge 2x thumb
The URL is created when the email is created, so the URL is formed and frozen at that time.  ie the email does not contain a formula at that point, but the formula is resolved into which rid and the value for now().
If you user were to do a "click here" on a link to that report or form, then the code would be refreshed to a more current "now".

If you do need to get at the value of now(0 form an email, one suggestion is to update a text field which has been set to log updates, and then use a formula to extract of the date / time that field was updated.