Discussions

 View Only
  • 1.  Lookup field for child table report link

    Posted 12-13-2019 15:26
    I have a many to many relationship between Assets and Service Orders. The third 'linking' table I called SO Asset Assignments.

    On my assets table, there is a child table for photos. 

    On my service order table, when I am displaying the report link to the SO assignments, I want to be able to have one column be the Photos report link.

    However, I cannot send that photo report link to the Service Order Asset Assignments as a lookup field, therefore it's not available as a column option to add. Is there a work around or something I am doing wrong?

    ------------------------------
    Mike Tamoush
    ------------------------------


  • 2.  RE: Lookup field for child table report link

    Posted 12-16-2019 10:32
    I taught how to do that at our Empower conference earlier this year if you'd prefer to watch a video:https://university.quickbase.com/empower2019-course/342287.

    If instead you're like me and prefer text information, the details here: https://help.quickbase.com/api-guide/filemanagement.html show how file attachments can be accessed. That then allows us to create a formula rich text field, with a formula like this:

    If([Image]<>"","<img src=\"" & URLRoot() & "up/" & Dbid() & "/a/r" & [Record ID#] & "/e8/v0/" & URLEncode([Image]) & "\" height=\"50\"></img>")

    Your version will most likely have a different number instead of 8 and your file attachment field will have a different label, but beyond that you can copy/paste this example.



    ------------------------------
    Eric Mohlman
    ------------------------------



  • 3.  RE: Lookup field for child table report link

    Posted 12-16-2019 10:48
    Eric can you explain what this part does? Is it to defeat caching when the image file is changed?

    If([file attachment]<>"","<img src=\"" & URLRoot() & "up/" & Dbid() & "/a/r" & [Record ID#] & "/e28/v0/" & URLEncode([file attachment]) & "\" height=\"50\"></img>")

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



  • 4.  RE: Lookup field for child table report link

    Posted 12-16-2019 11:33
    Mark,

    I put that in to handle any special characters in a file attachment name

    ------------------------------
    Eric Mohlman
    ------------------------------



  • 5.  RE: Lookup field for child table report link

    Posted 12-16-2019 12:07
    Edited by Michael Tamoush 12-16-2019 12:18
    Eric,

    Thanks - that is something I can definitely use. But I'm not sure how to adapt it to my need? In my case, I'm not trying to pass the image of the file to another table, but rather I am trying to pass the report link (containing all image files) from the parent table, down to another table.

    The use case being - once my asset is associated with a service order, there is a report link on that service order of all the assets related to that service order.

    In that report link, I was hoping I could show the asset name, and then a report link to the asset photos....

    So I need to get the asset photo report link from the asset (parent) table, then down to the assignments table (the link for the many to many).  


    ------------------------------
    Mike Tamoush
    ------------------------------



  • 6.  RE: Lookup field for child table report link

    Posted 12-16-2019 15:42
    Mike,

    Thanks for clarifying. I apologize if I misunderstood the original request.

    For report link fields, they simply need a "local" field and the "target" field on the table you're matching against. Based on your updated description, you should have a field on the Assets table labeled something like "Related Service Order". If you create a report link field on the Asset table, the in its field settings choose the Related Service Order as the local field, and the Assets: Related Service Order for the foreign field, it should show all Assets part of that same Service Order. 

    If that's not the actual setup you want to accomplish, keep in mind that the local field matches the target field as a general rule. This means you can display grandchild records on a table, or something with no relationship at all (i.e. I have a Widgets table with a "color" field, and as I'm looking at a product I can show all widgets with that same color).

    ------------------------------
    Eric Mohlman
    ------------------------------