Skip to main content
Solved

Querying from many-to-many table to populate field value

  • December 17, 2021
  • 0 replies
  • 191 views

I have a many-to-many relationship of employees to campaigns.  Each employee can serve one of three roles within a campaign.  In my scenario I will only ever have one employee serving each role.  Table design shown below:


Within the Campaigns table, I would like to be able to see the Employee name in each of the three distinct fields.  So Campaigns should have three fields called Assistant, Strategist, and Setter.  

The query seems fairly easily - basically something like "Select Employee Name from Assignments where Campaign = [Record ID#] and Role = 'Strategist'".  Unfortunately I cannot figure out how to make this happen...  Any suggestions on how to accomplish this?  Should I just abandon the many-to-many relationship and create three independent relationships?

TIA

------------------------------
Jeremy Lahners
LeadBaller
------------------------------

Best answer by MarkShnierYou

The combined text summary field only works on field types of text.  Your employee name field is actually a user field.

So just make a text Formula Field called [Employee Name (text)] with the following formula

UserToName([Employee Name])

and  summarize that field.

------------------------------
Mark Shnier (YQC)
mark.shnier@gmail.com
------------------------------
This topic has been closed for replies.

MarkShnierYou
Forum|alt.badge.img+24
The many to many is fine as is.

You can make a Combined Text Summary field on the relationships between Campaigns and Assignments to get the name of the person(s) filtered by the role = "Strategist".   If you don't like the "bubble" or "pill" appearance of that Strategist Name on the campaign record you can convert it to text 
ToText([Combined Text Strategist])

Then duplicate that summary field and filter on on Role = Assistant, and then duplicate again for Role = "Setter"

------------------------------
Mark Shnier (YQC)
mark.shnier@gmail.com
------------------------------