Forum Discussion

JonFroderberg's avatar
JonFroderberg
Qrew Cadet
6 years ago

Reports With API Filters Launched From URL Link Lose Filter Criteria

We have several report buttons on dashboards and forms in our apps that are coded to call the report and also apply various filters in the URL.  However, if the resulting report data set has more than one page of results, when a user clicks to see the next page of records, the report filters are lost when the screen refreshes.

URL to load the report:
https://hardermech.quickbase.com/db/bjjkii2fm?a=q&qid=227&query={9.EX.299008}AND{179.XEX.1}AND{281.LT.100}
Table Name: Milestone Data
Report 227
fid 9: [Job]
fid 179: [Delete This Milestone]
fid 281: [Scope % Comp]

When I run this report the result is three pages of records.
After I click on the link for the second page of records, the URL changes to this:
https://hardermech.quickbase.com/db/bjjkii2fm?a=q&qid=227&qskip=50&qrppg=50
And now the report is showing all the unfiltered records (460 pages).

One of the other developers, Jim, had a thought that maybe we could store and reference the filter criteria for the report in a javascript service worker, such that those values are stored in a stable location.
Any insight on how to overcome this report behavior would be greatly appreciated!

------------------------------
Jon Froderberg
PRIME Developer
Harder Mechanical Contractors
https://www.harder.com
Portland, OR
503.382.4413
------------------------------
  • AustinK's avatar
    AustinK
    Qrew Commander

    Do these buttons just contain the URL you specified above or are they going to a code page or doing any other javascript stuff before heading to that URL?

    Have you tried setting the reports up to accept user input or "ask the user" on each field you want filtered and then sending them to the report that way? I'm not sure if these survive going to the next page but they should. I know this isn't a solution to your exact problem but it might help you limp along until you can find a solution.

    So for your URL above it would be something like this where v0= is the first field you are asking for user input on, then if you wanted more they go up as you would expect the next would be v1=:

    ?a=q&qid=272&nv=1&v0=299008&v1=1&v2=100

    Then on the actual report you would set the filters to "ask the user" and set them up how you want them to behave as well. As in setting the fields to "is equal to" and getting the and/or's set up properly. 

    • JonFroderberg's avatar
      JonFroderberg
      Qrew Cadet
      We have a mixture of buttons. Most of them just go directly to the URL embedded in the button. There are a few that go to external web pages and a few that go to code pages within our Quick Base realm to do some more complex functions such as Workato. The example in my original post is just a direct URL.

      I will experiment with the "ask the user" approach. Thanks for the suggestion! Our goal was to create a page of buttons embedded in a single formula rich text field that would all be filtered based on the page/table/record they were launched from. Simpler experience for the user!  We are also experimenting to determine whether we can overcome the page coding limiting the report results.

      ------------------------------
      Jon Froderberg
      PRIME Developer
      Harder Mechanical Contractors
      https://www.harder.com
      Portland, OR
      503.382.4413
      ------------------------------
      • MarkShnier__You's avatar
        MarkShnier__You
        Icon for Qrew Legend rankQrew Legend
        If you are making a button to launch off a record which inherently knows the answer to a question, it's very easy to create a simple URL formula button which runs the <ask the user> report and answers the question. 

        Urlroot() & "db/" & dbid() & "?a=q&qid=9&nv=1&v0=" & [branch]

        This would be an ask the use Report which will run filtered in a branch value  in the record.

        ------------------------------
        Mark Shnier (YQC)
        Quick Base Solution Provider
        Your Quick Base Coach
        http://QuickBaseCoach.com
        markshnier2@gmail.com
        ------------------------------