Xpath date constrains

0
Hello, i want to retrieve all objects that was created more then a year ago,  i written this constraint: [year-from-dateTime(createdDate) - 1 > '[%CurrentDateTime%]']   i’m getting an error: “Mismatched input ‘-’ expecting BRACKET_CLOSE”
asked
2 answers
3

Hi 

Above condition wont work because we can’t perform operations like add or sub in X path with attribute

Create a variable like below and use new variable in the xpath as shown below

 

answered
0

See documentation here: https://docs.mendix.com/refguide/xpath-keywords-and-system-variables

Use something like [TestDate >= '[%CurrentDateTime%] - 1 [%yearlength%}'] in your Xpath.

Regards,

Ronald

 

answered