Email Notification with list of data on email body



Any one came across a requirement like you need to send the email notification once a team is approved with the list of team member details on the email body.

I have team id as the record id and team member details are available in a smartbox smartobject.


When i do get list on the email body its returning empty when there are multiple team members and if there is only one team member it shows the data. 


Hope you got my question. Please help.


Thanks in advance.

0 Kudos
1 Reply

Re: Email Notification with list of data on email body

Hi Dubai


As you have discovered dropping a SmartObject list method onto the email body will not display the data as expected.


There are 2 approaches you can take.


Use Activity Destinations to Loop Through Results


  1. Add an activity (before the email event) and run the Destination Users wizard in advanced mode
  2. Select Plan per slot (no destinations)
  3. On the next page drop the smartobject list method into the "Select a list field to determine how many slots should be created"
  4. Add the input mappings and/or filter to get the list of data you want, and then select the PK Id field as return property
  5. On the next page select "Return all results that match the filter". You can add ordering to if you want.
  6. Create a process level string data field to hold the list of values you want
  7. Add a Data Event to the Activity
  8. Click the Assign button
  9. In the Destination drop your process data field
  10. In the Source add an expression (Function Browser -> Expression)
  11. In the Expression you will concatenate the process data field with the result of a read smartobject. For example you could comma separate list all results, or construct an html table
  12. Add the process data field to the expression and an "&
  13. Drop the SmartObect read method to the expression (set it to the read method for the same smartobject you used above for list)
  14. In the Input mappings you will need to do the following:
  15. Select the "To Integer" function in the Conversion folder of the Function Browser
  16. Drop the "Instance Data" from the Activity Destination Instance folder on the Workflow Context Browser into the Value
  17. In the Return Mapping select the field you want

This will loop through each item in the list and concatenate the result to the previous results to give you all of the values. If you need to return more than one field you can modify above appropriately.





The other approach is a bit more complex and involves XML and XSL. I wont go into detail, but basic steps are:

  1. Create an XML process field that maps to the data you are returning from he list method
  2. Add an default activity 
  3. Add a SmartObject event and execute the list method and map the results into the XML data field
  4. Add a data event
  5. Select "Transform Data with an XSL Template"
  6. Transform the XML with XSL (you will need to create an XSL file) using a Data Event into HTML into a process string data field

Let me know if you need help of more detailed instructions.