I am able to get child items from parent list where i have a repeating section following: Repeating section as html table in mail. I am also able to filter repeating section data and put it into HTML. However, i am not able to send separate emails based on choice. Below is the scenario:
I have a choice field called company, and example choices are: 1, 2, 3, 4, 5, 6. I want to be able to send one email and the contents related inside the repeating section from company 1, 2, and 3 to one set of users, and the contents related inside the repeating section from company 4, 5, and 6 to another set of users. How do i accomplish this?
Solved! Go to Solution.
You'll have to query the XML output of the repeating section and write the XPath to return the values for each node.
If you save the Repeating section control to a plain text multi line column, you'll be able to query that columns values.
I'm assuming the format will be pretty standard, so you can store the outputs for each row in a new collection. Search the collections at the same index for the Company value, and if that value is met, use a Conditional action to send the email to the appropriate recipient with the values from the collection.
No worries about the randomness of rows in the repeating section. You can do a count for particular nodes in the XML. From there, you'll run a for-each loop on the number of nodes.
I figured this out.
I just had to add a xsl:if for each branches based on condition (companies), then insert run if action if the variable is not empty, and finally send email with that variable: