How does the "&z=" function work?

  • 0
  • 1
  • Question
  • Updated 5 months ago
  • Answered
I found a post on here that recommended using "&z="&Rurl() at the end of a GenAddRecord formula in order to, upon saving the opened form, redirect the user back to where they started from. This works great, but I would like to understand what's going on, because these functions seem useful in a variety of situations. 

So the way I think it works is that "&z=" tells the form where to go after the save button is clicked. Does that mean Rurl() is just the url of the record, and I could put any url in there to customize this function? 

Thanks
Photo of Alex Gale

Alex Gale

  • 1,124 Points 1k badge 2x thumb

Posted 5 months ago

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

QuickBaseCoach App Dev./Training, Champion

  • 51,436 Points 50k badge 2x thumb
if you use the syntax like

var text AddRecordForm = ... and put your GenAddRecordForm URL here;

var text DoSomethingNext = and put your next URL here;

then you can do this

$AddRecordForm 
& "&NextURL=" & URLEncode($DoSomethingNext)
Photo of Alex Gale

Alex Gale

  • 1,124 Points 1k badge 2x thumb
Thanks
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 51,436 Points 50k badge 2x thumb
The z= .. syntax does something that you cannot replicate in any other way, as far as i know.  For example, if you launch off a report with dynamic filers set to add a record, it will return you to that same report  and preserve the Dynamic filters.
Photo of Alex Gale

Alex Gale

  • 1,124 Points 1k badge 2x thumb
So is it only used as z=Rurl? I thought it might be a more flexible option, say if I wanted to redirect to a specific record after a user fills in a GenAddRecord form. 
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 51,436 Points 50k badge 2x thumb
I don't believe you can mess with that z=rul.  it does what it does in that syntax.  But you can use the NextURL syntax if you know where you want to go to after the record is saved.
Photo of Alex Gale

Alex Gale

  • 1,124 Points 1k badge 2x thumb
So I can't, say, take information from the record that is being launched from, and then use that to inform where the user goes after they click the save button? 
Photo of Rob White IV

Rob White IV

  • 948 Points 500 badge 2x thumb
Here is a good article for you to check out: https://community.quickbase.com/quickbase/topics/using-z-rurl-and-rdr-in-formula-url-fields 

Should answer your questions,

~Rob
Photo of Alex Gale

Alex Gale

  • 1,124 Points 1k badge 2x thumb
Funny, that's actually where I got the question from. The article doesn't really go into what exactly "&z="&Rurl() is, just what its most common use cases are. 
Photo of Rob White IV

Rob White IV

  • 948 Points 500 badge 2x thumb
Ah, I gotcha. 

Well, the way I read it is that it was introduced as a hack and can only be used in two ways (or really one way that can be arrived at in two ways). 

 

I wouldn't incorporate it into my stuff outside of the very narrow description offered in that article and probably wouldn't do it even then if I could help it.  Which, apparently I have because I can't recall using it to date.    

Let me know what you learn though.  You may find some cool stuff.

Thanks,

~Rob
Photo of Alex Gale

Alex Gale

  • 1,124 Points 1k badge 2x thumb
Ah well it's still useful even in this one narrow situation I suppose. And I can use the NextUrl thing for other situations. 

Thanks