I wish to get most recent collection from my json array based on created date in logic app variable or using dot liquid transformation.
{
"content": [
{
"properties": {
"id": "957777746054",
"owner": "jFinder",
"created": "2021-03-30T04:12:18+0000",
"updated": "2021-03-30T04:12:18+0000",
"revision": "1"
}
},
{
"properties": {
"id": "957777725902",
"owner": "jFinder",
"created": "2021-03-29T16:50:21+0000",
"updated": "2021-03-29T16:50:21+0000",
"revision": "1"
}
}
]
}
My idea was to sort this by "created" and then iterate over to pick first/last. But sort logic is not working. Can you help?
My liquid map start with
{% assign current = content.properties | Sort: "created" %}
{%- for item in current %}{"id" : "{{ current.id }}",do whatever} {%- endfor -%}
this always returns nill. I replaced created with id to see if that works but also didnt help