Forum Discussion

AnithaJ's avatar
AnithaJ
Qrew Cadet
27 days ago
Solved

Join Table help

I have 3 tables in my Quickbase App,

Assignments (PhoneNum is key),

Member (PhoneNum_MbrID is key but has PhoneNum field),

Calls (Record Id is key but has PhoneNum)

Assignments is connected to Member (one to many)

Assignments is connected to Calls (one to many)

I have to create a table report from Calls table and pull all member table data. How can I achieve this? Please help.

  • OK, maybe I now finally understand the question. What I would suggest doing is to create a new table called Member Calls.  This would be a Join table between Members and Calls.  It would also be a child of Assignments.  So each record would have three parents. 

    Then, for example, when an assignment has been completed, the user would push a button to update a date time field, and that would trigger a pipeline.

    The Pipeline would create a Bulk Upsert for the Member Calls Table.

    Then it would Search for all of the Calls within the Assignment and then in the For Each Loop, it would add a row to the Bulk Upsert to populate {related Assignment] [Related call]  and [Related Member].

    Then the last step would be to Commit the Bulk Upsert.

    A Bulk Upsert is the best practice as compared to directly adding those records one by one inside the For Each Loop as it will be less impactful on the performance of the app for your human users.  Also, if you try to add the records, one by one, it is theoretically possible that your app might get over busy and the Pipeline could fail along the way.  

     

14 Replies

  • I'm not quite sure what you mean by "all the information from the member table" but for example, if you meant a list of the member names, then you can make a combined text  summary field on the assignments table (you do this on the left side of the relationship between Assignments and Members) to roll up all of the unique member names up to the assignment table.  

    In my opinion, they will look kind of funny because they will appear in that bubble format that Quickbase uses for Combined  Text summary fields.  So I suggest making this text formula.

    SearchAndReplace(ToText([Combined Text Member Name]), " ; ", "\n")

    which will reformat that in to a vertical list.

    Then look that up down to the Calls table.

     

    If there are a few additional fields that you want rolled up, you would go to the members table and make a formula field that combines say two or three fields from that table into a string. And then roll that up to the Assignment table instead of  just the  name. 

     

    • AnithaJ's avatar
      AnithaJ
      Qrew Cadet

      Thank you Mark! I basically need a table report created from Calls table with below fields. The user wants to have this table report created so they can download and use.

      Calls - Phone Num, Call Id, Call Placed Date, Call Detail, Member Id, Member Name

      123-345-6789,5671,Sep 10,2025, Information Shared,Mbr001, Anitha J

      123-345-6789,5671,Sep 10,2025, Information Shared,Mbr002, Paul

      234-567-8901,3456,Sep 11,2025, Left voicemail,Mbr003, Peter Pan

      • MarkShnier__You's avatar
        MarkShnier__You
        Icon for Qrew Legend rankQrew Legend

        I am a bit confused. Are these your relationships?  

        One Assignment has many Calls

        One Assignment has many Members

        Does the Call record know who was called?

  • If the phone number is unique, you van make it the key field of the Members table.  Then you can look up the Member info down to the Call.

    As a safe first step, can you see what happens if you set the Phone Number in Members to be unique and click to check if its in fact unique.  Or make a summary report on Members sorted by the # of members based on Phone number and see if there is just one member per phone number.

    • AnithaJ's avatar
      AnithaJ
      Qrew Cadet

      A phone number can have multiple members. So we cannot make the phone number field unique. 

      • MarkShnier__You's avatar
        MarkShnier__You
        Icon for Qrew Legend rankQrew Legend

        So conceptually, for example, if the phone number called is 123-345-6789 and multiple members have that phone number, how do I know which particular member was called?  Is it that the assignment record would only have that one member for that assignment?

  • Are you saying that you want a report so that for each Call, there is a record for each Member of that Assignment?  

    • AnithaJ's avatar
      AnithaJ
      Qrew Cadet

      Yes. Please review the example provided with how the data is expected to be in the report.

      • MarkShnier__You's avatar
        MarkShnier__You
        Icon for Qrew Legend rankQrew Legend

        OK, maybe I now finally understand the question. What I would suggest doing is to create a new table called Member Calls.  This would be a Join table between Members and Calls.  It would also be a child of Assignments.  So each record would have three parents. 

        Then, for example, when an assignment has been completed, the user would push a button to update a date time field, and that would trigger a pipeline.

        The Pipeline would create a Bulk Upsert for the Member Calls Table.

        Then it would Search for all of the Calls within the Assignment and then in the For Each Loop, it would add a row to the Bulk Upsert to populate {related Assignment] [Related call]  and [Related Member].

        Then the last step would be to Commit the Bulk Upsert.

        A Bulk Upsert is the best practice as compared to directly adding those records one by one inside the For Each Loop as it will be less impactful on the performance of the app for your human users.  Also, if you try to add the records, one by one, it is theoretically possible that your app might get over busy and the Pipeline could fail along the way.  

         

  • Maria's avatar
    Maria
    Community Manager

    This post makes clear to me why MarkShnier__You​ is a QrewLegend! I'm desperately trying to follow the logic, lol. I always did better solving a problem once I could see the app structure directly... 

    I'm not sure if the existing relationship between Assignments and Calls is one Assignment can have many Calls, or if one Call can have Many Assignments. I'm assuming the former. So if a Member has many Assignments and Assignments can have many Calls, then it should be a simple thing to have Assignments lookup Member info from that relationship and if the Member info exists on the Assignments table it should be easy to then lookup Member info from the Assignments to the Calls. 

    I think your best bet is to open a support ticket and grant the Tech Support Engineer access to your app so they can see exactly what we're working with and can then give you advice that is relevant to your specific app. 

    The point that I have no confusion around is MarkShnier__You​'s advice to use a Bulk Upsert. He is spot on about the performance impact to the app. It's the kind of thing that will *probably* never be enough to slow the app down, but if you can build it better from the start, then why risk it?