Forum Discussion

JustinFerris's avatar
JustinFerris
Qrew Member
3 years ago

Routing User to Different Form Based on Field Value

Hello,

I have a process where users view a case file and work the file. We have grown so now we have several different types of case file and need to use a different form for each file type. I can imagine several ways to do this, but none are clean. Below is a list of what we tried.

  • We tried using an iframe that linked to a formula url field, this worked except is displays the QB header twice and limits the screen size (iframes are apparently not responsive in QB).
  • We tried using one "mega-form" with conditionals, but we hit the embedded report limit and certain fields need to be on multiple forms which QB disallows.
  • We tried creating a different table for each file type but that breaks QB search widget (search widget can only search 1 table at a time).
  • The best solution we found was to create a rich text field that displayed a link to the various case type forms, but then we lose the functionality of the edit and view buttons that display on every report and the search widget.

Are there any other solutions to this issue?

Edit: The real issue seems to be QB does not support building code at the routing stage of the application. Is this common web application functionality being considered for a future update?

------------------------------
Justin Ferris
------------------------------
  • Hi Justin,

    You could use a rich text formula field to display a button that would take you various forms based on a field value.   

    Something like this assuming the value is just simple number value:

    var text myURLone = URLRoot() & "db/" & [_DBID_JOBS] & "?a=er&dfid=21&rid=" & [Record ID#]  //takes you to form id 21 in edit mode
    var text myURLtwo = URLRoot() & "db/" & [_DBID_JOBS] & "?a=dr&dfid=14&rid=" & [Record ID#]    //takes you to form id 14 in display mode

    Case([MY VALUE],
    '1', "<a class='Vibrant Success' style='border:1px solid #ffffff; background-color:#f2274c' href="&"\""& $myURLone &"\""&">URL1</a>",
    '2', "<a class='Vibrant Success' style='border:1px solid #ffffff; background-color:#f2274c' href="&"\""& $myURLtwo &"\""&">URL2</a>"
    )

    You can customize what the button looks like for each condition as well.   Also note that you can drop them into the form in 'edit' mode or 'display mode'.



    ------------------------------
    Jeff Peterson
    ------------------------------
  • AustinK's avatar
    AustinK
    Qrew Commander
    This sounds like it could be done fairly simply it just depends on how they are getting to the records I guess.

    Have some kind of identifier on the record that says the type it is. Have a formula that then determines the right dfid based on the type. You may need to create your own edit and view buttons, this can be done in rich text and used to replace the the native buttons by hiding the native ones in the report itself. This would allow the edit and view buttons to take into account the dfid formula I mentioned above and take users to the correct form based on the doc type.

    I can break that down further into actual code that may be needed if you want, let me know. I figured just giving the idea for now might spark something.
  • Was looking to do something similar and stumbled across this old post.  Was wondering if any of the new functionality in Quickbase has changed this?  I don't want to necessarily create a button for the user to hit, I'm just seeing if there is a way natively in QB that if the record meets condition 1, the record will open in Form A and if it meets condition 2, it will open in Form B, regardless of the role of the user.

  • There is no such feature yet.

    You should look at a Form Rule to control what is displayed.  As long as you do not exceed the form limits the way Justin did, it will do quite a bit.

    The Rich Text field is also a good option to send your user to a specific place.  You have to learn some syntax but it is quite powerful.