XPath constraint in ListView

0
Hello everyone, I’m trying to constrain a list view of the following Entity.  The aim is to show a list item only when the current user, who is signed in, has the same name as it is in “UserName”. So that he can only see his own entries.  I tried to do it with XPath, but failed: I used the Mendix login forms and the name which is written in UserName in the Entity is the same name, which is used to log in.  Does anyone have any suggestions for me? Best regards and thanks for your help.
asked
1 answers
5

The keyword '[%CurrentUser%]' is not available when no association is available to the user.

What you now have is comparing the string '[%CurrentUser%].Name'  to the value of the field UserName, this will probably not return any results.

To achieve what you want you can create an association to the user entity and then filter in based on the current user, or depending on how your app works you could used the owner and/or changedby system attributes to filter on the current user.

With an association to the user your xpath needs to read like:

[MyFirstModule.Activity_User = '[%CurrentUser%]']

hope this helps in finding a solution to your request.

answered