(such as a contact with a specific affiliation type)
Add a Where clause to the foreach loop to filter:
For example, the manure hauler is:
<<foreach [contact in contacts.Where(x => x.affiliationTypeCode == “MNR_HAUL”)]>><<[contact.contactName]>><</foreach>>
If you want to protect against multiple matching contacts being returned (such as 2 or more manure haulers in the example above), then add Take(1) to the markup:
<<foreach [contact in contacts.Where(x => x.affiliationTypeCode == “MNR_HAUL”).Take(1)]>><<[contact.contactName]>><</foreach>>