Send to Multiple Email Address(es) based on selected check boxes and querying a SharePoint List

  • 21 October 2020
  • 9 replies
  • 36 views

Badge +4

Hello All,

I have looked at many posts but just can't seem to get there.  I have a Form that has multiple checkboxes for branches. 

9286i50BB1C153399E5EA.png

The requirements are for the workflow that it will only send to those folks at those branches and not all.  

I created a Sharepoint list to pull the information from

9287iFAEF3F6742617390.png

In the Workflow (based on other posts) I created two collection variables

9288i0D678931851F622F.png

Then I created a query filtering by Branches

9289iB16DC78B6B3E99AC.png

If they select "All Branches" it will send to everyone listed no issues.

If they select just Atlanta it works

If they select Atlanta, Dallas it errors and gives this error

9290iEA530FA5724865CA.png

Because I like to try everything I did try to create a group to put in place of the individual emails and same thing happens. It will work for the one but not if several are selected which is what I need.

9291i58D9961AB2E68C24.png

HELP! I feel I am so close!

I am using on Prem Nintex Forms and Workflows 2013

 


9 replies

Badge +1
Are you separating the resulting email addresses with a semicolon and a space?
Badge +4

It is using a Person or Group Type Column so it does that automatically.

Badge +1
Another possibility is that there is an issue with the separator in the Branches field/column itself... possibly within the Query List filter.
-or-
Have you tried Branch Location |contains| Branches?
Badge +4

I tried that and it didn't work.  I even put another column in with single text field and put the email addresses with ; and space between and tried the contains and is equal to and it errors.

Badge +9

If only 1 tick box is selected the result would be "All Branches" and the list query works as it finds "All Branches" in a single record

 

If multiple boxes are ticked the results would be "Atlanta, Miami" and the list query can't find any records that match that exactly (as you have atlanda, and miami in separate lines.

 

So you'll need to first parse the branches selection using a regex, spiting on "," and storing in a collection

9307i86A57EFDC2A9F3AA.png

 

then you do a for loop on the collection (it will run once for each branch (create a text variable) found in Branches)

9308iF14E04A9EEE1F55C.png

 

Then in the loop add the query record updating to use the variable "branches" to query with and send the email

9309i4EC471F4E67E012C.png

 

Badge +5
I agree with Warwick, that is the method we use also.
Badge +4
Ok I will try to implement and test and let you know.
Badge +4

So should I not be using a separate list for Branches and Branch Contacts?  

Badge +9
Either way works, which ever is ok.

Reply