# Action : to all matching occurences, not just first one

**URL:** <https://community.glideapps.com/t/action-to-all-matching-occurences-not-just-first-one/73594>\
**Category:** Ask for Help\
**Created:** [May 23, 2024, 10:39am UTC](https://community.glideapps.com/t/action-to-all-matching-occurences-not-just-first-one/73594 "2024-05-23T10:39:05Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![zak\_solstice](https://avatars.discourse-cdn.com/v4/letter/z/898d66/32.png) [@zak\_solstice](https://community.glideapps.com/u/zak_solstice)\
**Post date:** [May 23, 2024, 10:39am UTC](https://community.glideapps.com/t/action-to-all-matching-occurences-not-just-first-one/73594/1 "2024-05-23T10:39:05Z")

</div>

Hi everyone,  
First of all, thanks for all the tips and solutions I’ve already found in other threads !

I’m stuck with this issue :

I have a list of contacts (ALLArtists), that I want to send a custom e-mail to based on criterias, using a single button, that sends to all contacts matching the criterias.

My logic :

- Action : if (list of contact) matches xx and yy criterias =\> send this custom e-mail

The button is placed above a Collection list of the “ALLArtist” data.  
However it only seems to take into consideration the first row of my ALLArtist data.  
Meaning : if the first Artist matches the criterias, the button is visible and once clicked, sends the e-mail to the Artist in question.  
But not to the rest of the matching Artists.

My workaround for now :  
If i add the same button IN the list, so on each row of Artists, then it appears for the ones matching the criterias, and I can click them one-by-one.

What should I do so that the “main button” above, actually sends to ALL matching occurences of my table ? if that’s possible…

Thanks a lot !

 ![Screenshot 2024-05-23 at 12.12.15](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/6/4/6428f8291944ee15a4242e3925619811db6d35a9.png)

 ![Screenshot 2024-05-23 at 12.21.44](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/4/8/487783f0fc09d614098b5a498ea524b4101aedcc.png)

---

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [May 23, 2024, 10:43am UTC](https://community.glideapps.com/t/action-to-all-matching-occurences-not-just-first-one/73594/2 "2024-05-23T10:43:21Z")

</div>

> [@zak\_solstice](#):
>
> Action : if (list of contact) matches xx and yy criterias =\> send this custom e-mail

Instead of applying this logic in the action, create an if-then-else column that returns the email address if the matching conditions are met. Then create a joined list column that targets the if-then-else column, and use that as the recipient list in the action. You can also use it as a visibility condition on the button - only show it if the joined list column is not empty.

---

<div class="post-metadata">

**Author:** ![zak\_solstice](https://avatars.discourse-cdn.com/v4/letter/z/898d66/32.png) [@zak\_solstice](https://community.glideapps.com/u/zak_solstice)\
**Post date:** [May 26, 2024, 1:38pm UTC](https://community.glideapps.com/t/action-to-all-matching-occurences-not-just-first-one/73594/3 "2024-05-26T13:38:14Z")

</div>

Hi @Darren_Murphy thanks a lot for your quick reply!

Unfortunately this solution is not appropriate for me because the e-mail is custom made for each recipient (using a Template column), so the Joined list wouldn’t be the right solution, i need to send separate e-mails. (however, this process will help me for something else, so thanks again!)

With this in mind do you have an other idea maybe ?

Thank you so much for your help,

Zak

---

<div class="post-metadata">

**Author:** ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)\
**Post date:** [May 26, 2024, 11:27pm UTC](https://community.glideapps.com/t/action-to-all-matching-occurences-not-just-first-one/73594/4 "2024-05-26T23:27:08Z")

</div>

If that’s the case, I think you would have to send it to [Make.com](http://Make.com) as a JSON array.

Something like:

```auto
[
{
"email": "a@example.com",
"name": "Thinh Dinh"
},
{
"email": "b@example.com",
"name": "Zak Solstice"
}
]

```

Then loop through the array and parse the variables out to send personalized emails to recipients.
