Discussions

Expand all | Collapse all

Creating a URL based on a record ID

  • 1.  Creating a URL based on a record ID

    Posted 04-23-2019 21:54
    I have an automation that creates a new record on Table B when the existing record on Table A is modified. Due to the specific report I need, I could not create a traditional relationship between these two tables so I created the automation instead. When the new record is created on Table B, it will have a field that references the Record ID of the triggering record from Table A. I would like to make a formula URL field on Table B that creates a link to the triggering record on Table A. My assumption is that I need to do this using the record ID, but I'm not sure how. 


  • 2.  RE: Creating a URL based on a record ID

    Posted 04-23-2019 22:04
    Build a formula-URL field in your Table B:

    URLRoot() & "db/" & [_DBID_TABLE_A_ALIAS_NAME] & "?a=dr&rid=" & [Table A  Triggering Record ID#]




  • 3.  RE: Creating a URL based on a record ID

    Posted 04-23-2019 22:36
    What if the triggering table (Table A) is actually 4 different tables that all feed into Table B? Is there a way to make the table ID a dynamic value changes based on the origin of the record ID? Or would I have to make a field that populates the table ID based on the original and then feed that field into the formula?


  • 4.  RE: Creating a URL based on a record ID

    Posted 04-23-2019 22:41
    You would have to pass in the DBID of the originating table to hardcode the "db/xxxxxx" of the source as well as the Record ID# of the record.  You can do this easily enough using a formula field in your Table A (4 variations) and just populate a text-value with that dbid when you create your Table B records.

    Then your formula would be:

    URLRoot() & "db/" & [Source Table DBID] & "?a=dr&rid=" & [Source Record ID#]


  • 5.  RE: Creating a URL based on a record ID

    Posted 19 days ago
    Hello Laura.

    I've been using the same formula that you have laid out, though "&dfid=11" was added after the Record ID# in my formula.  It was working for a few months but then just a week or two ago it quit working.  Below is what my formula actually looks like:

    URLRoot() & "db/bpiur66d5?a=dr&rid=" & [Record ID#] & "&dfid=11"

    Can you see anything as to why it wouldn't work?  (I've also removed the "&dfid=11" from the formula with out any luck)

    Did Quickbase make any changes as to how record ID #'s are identified?​

    ------------------------------
    Christopher Job
    ------------------------------



  • 6.  RE: Creating a URL based on a record ID

    Posted 19 days ago
    Have you copied your app?  Did the table identifier change?

    If you are building a button to display the same record on an alternate form, then it is better to use this syntax

    URLRoot() & "db/" & dbid() & "?a=dr&rid=" & [Record ID#] & "&dfid=11"

    The dbid() will always return the table that you are now sitting on.  Hence it is not good practice to hard code the table ID as if you copy the app, it will fail.

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



  • 7.  RE: Creating a URL based on a record ID

    Posted 19 days ago
    It is a button, but it's linking to a form in a different QB app which is why the table ID is hard-coded.  I double checked that I had the correct table identifier and URL root; nothing changed there.  

    I get a "Not Found" error telling me that the form "has probably been deleted" (though I know it hasn't).

    ------------------------------
    Christopher Job
    ------------------------------



  • 8.  RE: Creating a URL based on a record ID

    Posted 19 days ago
    But do these two tables have the identical Record ID# for the record you are launching off of?  Seems pretty unlikely.  i would expose the URL to see the Record ID# by temporarily removing the button text (or just look at the record to see its Record ID#]and see if the target table has a record with that identical record ID#.

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



  • 9.  RE: Creating a URL based on a record ID

    Posted 19 days ago
    No, the one table/forms on App A is just grabbing info from App B, then providing a button link to take you to the actual form on App B. 

    I believe I found the issue.  I was using a numeric field on a form in App A to grab the record ID # of a form in App B, but someone had created another numeric field in App A with the same name. So I had two fields with duplicate names and the formula couldn't reference the correct one.  ​​I've remedied that and it all works now. 

    It's interesting though that accessing the form directly through App B, I see that the Record ID # is NOT contained in the URL.​
    URL root...db/bpiur66d5?a=dr&r=ku&rl=r73&dfid=11     vs.    URL root...db/bpiur66d5?a=dr&rid=338&dfid=11
    ...the first being direct access and the second being access through link formula.



    ------------------------------
    Christopher Job
    ------------------------------



  • 10.  RE: Creating a URL based on a record ID

    Posted 18 days ago
    Edited by Mark Shnier (YQC) 18 days ago
    Quick Base has two different systems for identifying records.  when it says &rid=123 then it is referring to a regular base 10 normal numbering system.

    when it says &r=ku then it is using a Base 32 encoding system.  There is likely some historical legacy reasons for this as Quick Base was invented in the late 1990s and perhaps memory was expensive back then, so storing in Base 32 may have been more efficient back then.

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



  • 11.  RE: Creating a URL based on a record ID

    Posted 18 days ago
    That is excellent information for Quick Base admins/programmers to know!  Thank you for that explanation, Mark!

    ------------------------------
    Christopher Job
    ------------------------------



  • 12.  RE: Creating a URL based on a record ID

    Posted 18 days ago
    I thought I posed this, but it seems it did not take,

    if you make a formula numeric field

    QB32Decode("ku")

    the result is, indeed, 338.

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