I've got 2 separate array's in separate session variables full of other arrays. I'm trying to pull out one attribute of an array based on the value output by another. It's essentially status codes in one (with other attributes) and a dictionary in the others.
They look like this :
Dictionary array
%array% [ { Id: '22', Name: 'Foo', Type: 'FooFoo', Description: 'More Foo', Enabled: 'true', Priority: 'number here' },
{ Id: '23', Name: 'Bar', Type: BarBar, Description: 'oh look more bars', Enabled: 'true', Priority: 'number here' },{...}]
and
Status array:
%array% [{ Id: '54', Name: 'Name goes here', Status: '23', BrandName: 'Brand'}],{...} }]
What i'm trying to do is something like
{%for Id in app.session.get('statusArray')%}
{% if Id.Status in app.session.get('dictionaryArray')%}
{{app.session.get('dictionaryArray').Name}}
{% endif %}
{%endfor%}
I've also tried
{{attribute(app.session.get('dictionaryArray').Name, Id.Status)}}
Or something to that effect.
TL;DR
I need to pull out the Name from the Dictionary Array based upon the 'Status: ' given by the Status Array