# How to send list of objects using single send APi

**URL:** <https://community.hubspot.com/t/how-to-send-list-of-objects-using-single-send-api/11595>\
**Category:** APIs & Integrations\
**Created:** [November 23, 2018, 8:10am UTC](https://community.hubspot.com/t/how-to-send-list-of-objects-using-single-send-api/11595 "2018-11-23T08:10:04Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/system/32/124_2.png) [@system](https://community.hubspot.com/u/system)\
**Post date:** [November 23, 2018, 8:10am UTC](https://community.hubspot.com/t/how-to-send-list-of-objects-using-single-send-api/11595/1 "2018-11-23T08:10:04Z")

</div>

Hi,

How to send list of objects to email template using custom property in single send api. Please go through below example template.

{{custom.RecommendationSteps }}

{% for item in custom.RecommendationSteps %}

**Topic Name:** {{item.TopicName}}

{% endfor %}

{“emailId”:“XXXXXX”,“message”:{“to”:“XXXXXXXXXX@XXXX.xxx”},“contactProperties”:,“customProperties”:[  
{“name”:“RecommendationSteps”, “value”:[{“name”:“TopicName”, “value”:“TopicNamexyz”},{“name”:“TopicName”, “value”:“xyz”}]  
}]  
}

---

<div class="post-metadata">

**Author:** ![IsaacTakushi](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/isaactakushi/32/70387_2.png) [@IsaacTakushi](https://community.hubspot.com/u/IsaacTakushi)\
**Post date:** [November 27, 2018, 3:57pm UTC](https://community.hubspot.com/t/how-to-send-list-of-objects-using-single-send-api/11595/2 "2018-11-27T15:57:33Z")

</div>

Welcome, [@Bharat\_Challapally](https://community.hubspot.com/u/bharat_challapally)!

At this time, custom properties passed via the [single send API](https://developers.hubspot.com/docs/methods/email/transactional_email/single-send-overview) _cannot_ be used in [HubL `for` loops](https://designers.hubspot.com/docs/hubl/for-loops).

The reasoning is the same as it is for [`if` statements](https://designers.hubspot.com/docs/hubl/if-statements) — all HubL logic executes _before_ custom properties and tokens are populated.

Here are some related topics:

- [If statement contact property](https://integrate.hubspot.com/t/if-statement-contact-property/1911)
- [Adding external data to create a company property](https://integrate.hubspot.com/t/adding-external-data-to-create-a-company-property/3835)

The team understands this is a pain point and hopes to support greater HubL flexibility in email templates in the future.

In the meantime, the best way to surface multiple property values in the same template is to pre-render the values in an HTML table and pass the HTML into the custom token.

Something like:

```auto
{{custom.Table}}

{
 "emailId":"XXXXXX",
 "message": {"to":"XXXXXXXXXX@XXXX.xxx"},
 "contactProperties":[],
 "customProperties":[
 {"name":"Table", "value": "<div><ul><li>TopicNameABC<\/li><li>TopicNameXYZ<\/li><\/ul><\/div>"
 }
 ]
}

```

While this method works, I recognize it isn’t an ideal solution and places the burden on you as the developer.

---

<div class="post-metadata">

**Author:** ![webmaestro](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/webmaestro/32/22117_2.png) [@webmaestro](https://community.hubspot.com/u/webmaestro)\
**Post date:** [March 18, 2020, 2:21pm UTC](https://community.hubspot.com/t/how-to-send-list-of-objects-using-single-send-api/11595/3 "2020-03-18T14:21:42Z")

</div>

In regards to this:

`The team understands this is a pain point and hopes to supportgreater HubL flexibility in email templates in the future.`

Some questions:

- Has any work been done to improve the HubL flexibility in email templates since this post was made in 2018?
- Is any work to improve the HubL flexibility in email templates planned for the next month? 6 months?

---

<div class="post-metadata">

**Author:** ![DMorrison7](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/dmorrison7/32/13631_2.png) [@DMorrison7](https://community.hubspot.com/u/DMorrison7)\
**Post date:** [April 7, 2021, 2:09pm UTC](https://community.hubspot.com/t/how-to-send-list-of-objects-using-single-send-api/11595/4 "2021-04-07T14:09:03Z")

</div>

I am also wondering if any work has been done to resolve this problem?

Same questions as above:

- Has any work been done to improve the HubL flexibility in email templates since this post was made in 2018?
- Is any work to improve the HubL flexibility in email templates planned for the next month? 6 months?

This puts the burden on the developer to write custom html and send it via custom properties to the email template. This is especially burdensome to work across marketing/development departments any time a small change needs to made to an email template. I greatly appreciate any response in regards to this.
