APIs & Integrations

Api
Member

Timeline Template if within each

I need to utillize logic within an each statement while iterating over the contents of 'extraData'. I would like to apply formatting based on a value within extraData. I cannot figure out the syntax to utilize #if within en each statement and have the if condition operate on the contents of the extraData.

For instance, suppose I have the structure below:
{

  item1: "value1",
  extraData: {

    itemData: [

    { itemTypeID: 1, itemName: "ItemName1" },

    { itemTypeID: 2, itemName: "ItemName2" }

    ]

  }

}

How can loop over the contents of itemData within extraData and format the data based on the itemTypeID?

Thanks so much for your help.

0 Upvotes
3 Replies 3
Api
Member

Timeline Template if within each

@mangelet I am curious as to if a custom module could be used in the timeline template to solve this as discussed in this post: https://community.hubspot.com/t5/CMS-Development/Timeline-event-template-custom-design/m-p/409898

 

0 Upvotes
dennisedson
HubSpot Product Team
HubSpot Product Team

Timeline Template if within each

@lindahl 👋

Maybe you have some thoughts on this subject!

0 Upvotes
Api
Member

Timeline Template if within each

Thank you for taking a look, Dennis. @lindahl I would appreciate any insight you may have. Thanks so much.

0 Upvotes