Hi Camilla,
We could combine them in different ways:
1. If a related entity name equals to a specific value, then change output.
e.g: I have arranged 3 appointments for my test contact:
* Assistance on Power Automate Configuration
* Discussion about Laptop purchasement
* Visit our factory

I nested a #if expression inside #each loop:
{{#each contact.appointment_contact_regardingobjectid}}
{{#if (eq this.subject 'Discussion about Laptop purchasement')}}
Laptop
{{else}}
{{this.subject}}
{{/if}}
{{/each}}

Output:

2. Only display related entity records if a field of contact equals to a specific value:
Hi {{contact.firstname}},
{{#if (eq contact.firstname 'Clofly')}}
we have arranged some appointments between us:
{{#each contact.appointment_contact_regardingobjectid}}
{{this.subject}}
{{/each}}
{{/if}}

Result:
Only Clofly could see arranged appointments for him.

Abbie could only see her firstname:

In addition, I would like share some supplements:
1. Sort result is random in each time.
2. By using conditional statements and comparisons, currently only text and number fields are good supported.
Regards,
Clofly