You can write clever XPaths which replicate if-then-else constructions, e.g. if you have a boolean variable called MyBoolean, you can write two clauses, one where the variable has to be true, and one where it has to be false:
[$MyBoolean and _DatumAanmaak > '[%BeginOfCurrentDayUTC%]']
[$MyBoolean = false() and _DatumAanmaak < '[%BeginOfCurrentDayUTC%]']
No, if-else conditions don’t exist in XPath. It’s more akin to a query language like SQL. Typically, if you need an if-else condition, you can leverage one in a microflow and then perform your retrieve later in the flow.
You could try to create your xPath combining the ‘And’ and ‘Or’ operators. An example with booleans:
[Condition1 = true()]
[(condition 2 = true() or condition 3 = true())]
Condition 1 should allways be true and If either Condition 2 or Condition 3 is true, the object(s) are returned