I've been struggling to find a solution for this. Despite trying subexpressions and various suggestions from StackOverflow, none of them seem to work because they require me to know the key in advance.
Here is the object I'm working with:
{
fields: {
1: {
complete: 1,
submitted: 0
},
2: {
complete: 1,
submitted: 0
}
}
And so on.
Within my Handlebars template, I'm iterating through an array of objects. Each object in the array includes a field_id
key that corresponds to a number found in the structure above.
My goal is to access the variables within the array structure based on the current field_id being iterated. I've attempted different syntaxes like:
{{fields[(field_id)].complete}}
{{fields[{{field_id}}].complete}}
{{fields.(field_id).complete}}
{{fields.({{field_id}}).complete}}
But unfortunately, none of them are successful.
Is there a way to achieve this?