Solved

Iterate through different email addresses in a repeating field

  • 4 January 2018
  • 4 replies
  • 25 views

Badge +9

I need to send notifications to each of these email addresses. Can anyone show me how to do this in the workflow?

icon

Best answer by glenda 9 January 2018, 14:39

View original

4 replies

Userlevel 3
Badge +12

Hi,

Is each email addresses in a row of a repeating section control? If so, were you able to get them into a collection variable from repeating section? 

Also share screen shot of your repeating section.

Thanks,

Krishna.

Badge +8

Hi Lars, 

Have you used a text field for input of the email addresses or is it a people field? 

The first will be easier to solve then the latter as you will need less steps to retrieve the correct email address without the "#i:0#.f|membership|". 

In case it is a text field:

  • Make sure you name your repeating section in your form: e.g. "RepeatingSectionEmails". Also give the email address field a name, let's say "EmailAddress".
  • It is possible to query the repeating section from your workflow, but it is even easier if you first connect it to a multiple lines of text field. So create a column, you could call it "repeating section output". Connect your repeating section to it from the control settings on your form. 
  • Open up your workflow, add the Query XML action
    • Input: the "repeating section output" column that you connected to the repeating section. 
    • XPath query: "//Items/EmailAddress" (only what is between the quotes)
    • Output: a collection variable that you create e.g. var_coll_EmailAddressesFromRepeatingSection.
  • Add a For Each action
    • Input: var_coll_EmailAddressesFromRepeatingSection.
    • Output value: this is the e-mail address that will be in your for each run. You can store it in a variable so you can easily use it. Create a variable var_text_currentEmailAddress.
    • The other settings I don't think you need. 
  • In your for each, you could include a send a notification action if you want to send individual notifications, just use the "var_text_currentEmailAddress" in the To field. If you want to send only one email to all email addresses at the same time, you need to configure and manipulate some more variables. 

Hope this helps!

Glenda

Badge +9

Thanks Glenda. This is how I did it. The collection operation at the end isn't necessary but I wanted to see the list of email addresses collected in the history list

Badge +1

Hi @glenda ,

Can you please help me on how to extract the Email address. I am using People Picker instead of Text field and I am getting as you mentioned "#i:0#.f|membership|". How can I get dele these characters and get only email addresses?

Looking forward for your support and many thanks in advance.

Kind regards,
Akash.

Reply