cancel
Showing results for 
Search instead for 
Did you mean: 

How to read list of contents and write onto email body? Is there a way to do this.

anoop9275
Deputy Chef I
Deputy Chef I

Trying to draft email alert which would have contents of list created. Need to understand if I do group mapping, it shows only 1 record wherein list have 100 record count. Greatly appreciate quick response on this. 

1 ACCEPTED SOLUTION

marlon-muela
Workato employee
Workato employee

Hi @anoop9275 ,

This is Marlon from the Support team.
You can try to drag and drop the list items on the message body. See sample below.

marlonmuela_0-1694752771384.png

 

View solution in original post

8 REPLIES 8

gary1
Executive Chef III
Executive Chef III

Send a screenshot of how you tried, maybe we can fix it.

anoop9275
Deputy Chef I
Deputy Chef I

anoop9275_0-1694013602293.png

I tied adding list onto email body but shows only 1 record. Need a way how to display all records of list.

gary1
Executive Chef III
Executive Chef III

I'm assuming the "Items" array contains objects that contain the Title, Address, and Manager data pills you're putting into the email body. When you use data pills from an array like this, it only grabs the first item in the array, which is why you're seeing only one result.

There are many options to display all of the items in the array, and here are a couple of my suggestions:

  1. Switch to formula mode, add in only the Items data pill and use [items].to_json. This will convert the entire items list to JSON and you'll get everything in them email body, but it won't look pretty.
  2. Switch to formula mode and use [Items].pluck('title').smart_join(', ') to make a comma-delimited list of all Titles in the array. You can repeat the same for each Address and Manager. I don't think this is a very good option, because I'm assuming you want to keep the data from each object grouped together.
  3. Create a message template that parses the Items array and generates either a text or HTML output for the email body. This takes more effort and maybe some learning, but it will produce the best looking result.

I think the most important thing you need to decide is how you want your email to look. If it needs to look good, the message template is your best option.

marlon-muela
Workato employee
Workato employee

Hi @anoop9275 ,

This is Marlon from the Support team.
You can try to drag and drop the list items on the message body. See sample below.

marlonmuela_0-1694752771384.png