One URL formula button to toggle between 2 reports depending on which report is being viewed currently?

  • 0
  • 1
  • Question
  • Updated 3 years ago
  • Answered
I want a single url formula button such that if I am currently viewing report #83 it redirects me to report #97, but if I am currently viewing report #97 it redirects to #83.
Is there a way to do this with one button? I know I could do this with 2 separate buttons but wanted to try it with one.

Thanks
Photo of Robin CC

Robin CC

  • 200 Points 100 badge 2x thumb

Posted 3 years ago

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

QuickBaseCoach App Dev./Training, Champion

  • 65,280 Points 50k badge 2x thumb
two buttons .... I mean once you make the first button, you just duplicate it and change the qid it's pointing to.
Photo of Ⲇanom the ultimate (Dan Diebolt)

Ⲇanom the ultimate (Dan Diebolt), Champion

  • 30,044 Points 20k badge 2x thumb
You are referring to reports 97 and 83. Do you in fact mean that you are viewing records 97 and 83?
Photo of Jack

Jack, Champion

  • 50 Points
Dan it certainly sounds that way, sound like navigating from parent to child record and back again or perhaps a predecessor.
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 65,280 Points 50k badge 2x thumb
I think Robin was asking the question she asked.  Can a URL button have an awareness of which report qid it is on, in order to build a formula which will toggle between calling up  two different reports.
Photo of Ⲇanom the ultimate (Dan Diebolt)

Ⲇanom the ultimate (Dan Diebolt), Champion

  • 30,044 Points 20k badge 2x thumb
>I think Robin was asking the question she asked.

If those numbers are  to be interpreted as qids, you are proposing to create an entire column in the report  which will contain exactly the same button. This would be an odd user interface as potentially 100s of buttons on the report would be capable of doing the exact same thing. With a script solution you can embed a single button in the report header as show here:

https://haversineconsulting.quickbase.com/db/bkfwuwx2p?a=td

A script solution will always be more flexible.
> Can a URL button have an awareness of which report qid it is on, in order to build a formula which will toggle between calling up  two different reports.

The global variable gReqQID will hold the qid of the current report being displayed. You can try and jam this value into a formula URL but the better approach is to escape from the formula language and implement the entire solution in pure JavaScript.