Api Workflow on a list on list


I have a data type called Good score.
Date: (date)
Fields: Score : (number)
Username: (text)

Each time a user gets a score below 10, I create a record in this table (thing) like:
Record 1: 03/09/2023 John Doe 9
Record 2: 04/12/2023 Mary Lee 8

What I am trying to do is, in the backend, sending each user in my app an email to notify them of the good scores.

I am not understanding the API workflow list, especially that I have two list here: (1) the user list, and (2) the list of good scores.


I’m not sure what lists have to do with anything here…

Can’t you just send the User an email when they get a good score? (i.e. when you create the record in the Score table)?

Thanks Adam.
Good question.
My user is a golfer. When playing a game, he enters the score on a hole. If that score is an Eagle (-2), then I write that score in the Good score thing (table). The user who is playing will not get the notification. However, I want all other users to be notified. There could be 100+ users who would be notified.


Ok, I see…

Well, I wouldn’t recommend using ‘Schedule workflow on a list’ here (although it would probably work just fine on 100 Users).

A better option would be to use a recursive workflow, to run over the list of Users (whatever that list is), and send the each the email.

Just trigger it when the Score is created.

Alternatively, and deepening on what email service you use, you can probably send a bulk email to all the users with a single API call to your email service. This is probably the simplest, and most performant method.

I see. Thanks.
I’ll see what I can come up with.
I cannot send the notification email as the score is created because, a golfer could change the score as he plays and therefore I might send two notifications for the same hole. What I wanted to do is to go through the list of Good Scores once the user clicks on the Game Completed button, not hole by hole. So, if the player has done 2 EAGLE hole (-2), I have to figure out a way to send either one email with bot EAGLE scores or two emails with each an EAGLE hole…

Thinkering on it…

Thanks again Adam. Hoping the weather is nice in your part of the world. Here, we’re slowly getting into spring. :slight_smile:

1 Like

I have found the solution. Thanks to @adamhholmes for his insight.

The data I want to send to users by email is a list of records I have save from a player’s game.
Anytime the player scored -2 (Eagle) or better, I save that data into the thing called “Golf Eagles-or-better-list”. Although Eagles are not scored regularly, it does happen and a good player could score more than one Eagle per game.

When the user clicks on Button End Game, I start by creating an API Workflow on a list of users.

This generates a list of users (who comply my Search criteria). The API Workflow I call is “send-email-eagle-bluk-for-game”.

Finally, that workflow (“send-email-eagle-bluk-for-game”), calls another API Workflow on a list called “send-email-onlist-eagle-data”. This API Workflow on a list is looking into the “Golf Eagles-or-better-list” thing and will send an email for each items found with a Game-ID for the game the player completed.

Here’s the screen capture of the send email action.

Finally, I have a field in the “Golf Eagles-or-better-list” thing (Field: “Notification-Sent”), which is set to YES so that I do not create an infinite loop.

Hoping this will help someone, sometime in the future.


This topic was automatically closed after 70 days. New replies are no longer allowed.