I have this example payload that I want to filter based on the datetime value :
[
{
"title" : "Article 1",
"createdDateTime": "2021-04-04T18:41:00"
},
{
"title" : "Article 2",
"createdDateTime": "2021-04-04T18:49:00"
},
{
"title" : "Article 3",
"createdDateTime": "2021-04-04T18:55:00"
}
]
I only want the articles that are created 15 mins ago so for example datetime now is "2021-04-04T19:00:00", I should only get the Article 2 and Article 3. Tried this expression but did not work :
%dw 2.0
output application/json
---
payload filter ((value) -> (value.createdDateTime as: datetime{"yyyy-MM-ddTHH:mm:ss"} <= now()-|PT15M|))
Is there a better way to do this? Thanks!