Why an XPath constraint does not work in Data source?

I need to filter the results, for which I use [Events.PartyInvitation_User=$currentUser]. This works in microflow but does not work in the Data source XPath. I cannot use it in the microflow, because I access attributes path (returning associated object) and getting this error: A grid based on a microflow cannot have attribute paths in its columns.
1 answers

If your data source type is 'Database' or 'Association' then you can just add the XPath constraint to the grid properties. For a data source of type Microflow, you need to constrain your data in the Microflow itself. An XPath constraint is basically a constraint in a database query and doesn't make sense when using a Microflow as source.

Update: I see now that you're referring to $currentUser as a variable, but the variable for this only lives inside a Microflow, in this case you should use the token which is '[%CurrentUser%]'