Hi Aspose team,
How can you filter in the template syntax on arrays in the json source?
example json:
> {
> "items": [{
> "item1": {
> "id": "1",
> "key1": "value1",
> "key2": "value2"
> },
> "item2": {
> "id": "2",
> "key1": "value1",
> "key2": "value2"
> },
> "item3": {
> "id": "3",
> "key1": "value1",
> "key2": "value2"
> }
> }]
> }
I’d like to reach the id of an element in the items[] that cointains(‘3’) or startWith(“item3”).
I tried something as:
<<foreach[item in items]>><<if[item.contains('3')]>>Id = <<[item.id]>><<else>> no item with 3 in the array <</if>><</foreach>>
However, this does not compile. How can you make use of functions to check the element with an condition? or is there any other way to get to the same result?
Many thanks,
Jeffrey