Selecting list value as input to grouped action

My app is used by a membership manager who often needs to send emails to multiple members.   I'd like the membership manager to be able to do the following:

  1. Select multiple members
  2. Click an "email members" action icon
  3. Select a template from a list of pre-made templates
  4. Have the chosen email template sent to each of the selected members.

Reversing steps 1 and 3 would work for me, if needed.  The only way I can think to accomplish this is quite cumbersome, so I'm hoping someone can point me to a better design pattern.  One option would be to use input() to capture the template choice, but it doesn't mention that it will display lists, so I'd need to build against the negative condition of "No template with that name found" and I don't think there is anything like a try{} capability.

Thanks in advance!

0 8 307
8 REPLIES 8

Add a table with 2 columns: [template] and [members]. Set up a Bot that triggers on new records on this table.

Yes, but how does that help me with step three in the process I outlined?  After the user has selected members and pressed a button that adds rows to the email/template table, I need to show a list of templates and have the user select a template.

I suppose I could create a view of templates with a default action of searching the email/template table for records without a template (and today's date) and apply the template from this new view, but I was hoping for a way to raise a prompt and I thought maybe input() might help.  

On a related note, is there a way to include the count of selected records within the confirmation message?

The user would select the template in the [template] column, from the same form as where they're selecting [members]. Not after the record has been saved. That's the whole point of the form.

 


@RedVox wrote:

On a related note, is there a way to include the count of selected records within the confirmation message


You can set a meaningless Action as Form Save, that includes a dynamic confirmation message. Search here for "confirmation message" for more.

 

Yes, that's part of the solution.  But the part I'm stuck on is can I get an action to repeat for each member selected.  With the table you suggested, I can make a form that saves a list of members and a given template.  But how can I iterate over the list of saved members to send an email to each one?  

You don't need to iterate over the members, you just send the email to all of them at once.

The emails are going to be personalized with details about the recipient.

Well that's a very important detail.

I would continue with the new table idea, then also add in a form save action that loops through the enumlist, creating a new record for each individual member, and set your bot to only trigger on records with a single member. Search this forum for "looping with actions" to see how to set that up.

The looping actions is not easy to understand.   Seems like a really elaborate workaround for what should be a very simple foreach loop.  I think I will just build a little web service to call after the initial form is saved. 

Top Labels in this Space