I currently have an export with a similar structure to below:
{
"record": {
"ParentId": "ParentId",
"IsDeleted": "IsDeleted",
"Name": "Name",
"Collection": [
{
"CollectionId": "CollectionId",
"CollectionName": "CollectionName"
},
{
"CollectionId": "CollectionId",
"CollectionName": "CollectionName"
}
]
}
}
Where 'record' is the parent object exported and collection are the related records associated with the parent.
I want to loop through the Ids in the collection and compare them to the Id in the Parent. I have wrote this handlebar to do this:
{{#each Collection}}{{#compare CollectionId "===" record.ParentId}}{{Name}}{{else}}Default Value{{/compare}}{{/each}}
I have tried record.Id and _PARENT.Id to access the value in the parent but the handlebar simply defaults to the default else statement.
Is it possible to access the values outside of a collection when using the #each helper? And if so, how can I do so?