XPath constraint link current user to a project

0
Hi everyone, I am trying: to link the current user (System.User) (the user entity has, by default, an attribute called "Name") to an entity Project (MyFirstModule.Project) (the Project entity has an attribute named "NameAttributeUser") My idea was to use the XPath constraint like this: To use a Microflow where I retrieve the "Name" of the System.User using the "First" range, then retrieve the Project entity using the "All" range. In this retrieve, I would use the following XPath constraint: NameAttributeUser = $AccountList_1/Name] In that way, the only project(s) that would be shown to the current user would be the project(s) where his "Name" is equal to the NameAttributeUser of the Project. My questions are: 1. Why does it not work? 2. Should I use the XPath constraint in the Microflow or on the Page? 3. Is there another way to solve this problem?
asked
2 answers
0

Could you please clarify what you mean by "User"?

  • If you are referring to the user who created the project, you can store the owner. You will find this in the entity properties under the System Attributes section, and then you can use the Owner token in the XPath.

  • If you mean something else by "User," you can add an association between the Project entity and the Account entity from the Administration module (which is a generalization of the User entity).

answered
0

1.  How does it work?

yes it is similar to Where clause in Database (with SQL) and it implies that constraint to filter the data with the name of the current user.

 

2. Should I use the XPath constraint in the Microflow or on the Page?

Xpath constraint can be used in a page in ListView/DataGrid or you can use inside a retireve activity in Microflow - both give same output.

 

3. any better way?

instead of adding name attribute, use an association between Project and USer entity and use the same.

answered