0

I'm working on a list of tasks. Users can request to be assigned to a task, and Admin can approve or reject this request.

I almost have it done, but have a problem with the XPath statement in the last 3rd step.


Implementation step-by-step:

  1. I created the tasks entity and associated it with the Administration.Account entity, this way I can assign users to tasks using reference selector.

enter image description here

  1. In each list item, there is a "request assignment" button, when User clicks on it, a microflow takes the name of the current user and saves it to the "requester" string parameter of this item.

  2. When Admin approves a request, a microflow should find the user with the same username as the one stored in the requestor parameter, and associate this list item with this user.

I have a problem with the last 3rd step. As you can see on the screenshot below, I created a microflow and I use Retrieve action to get the user from the database of all registered users. I use this XPath expression, which should help me get only one user, whose name is the same as the name stored in the "requestor" string parameter of the tasks entity:

[Name = $Tasks.Requester] 

But I'm getting an error, and don't understand how to fix it.

enter image description here

halfer
  • 19,824
  • 17
  • 99
  • 186
Rumata
  • 1,027
  • 3
  • 16
  • 47
  • The image in your first step shows the element name as `requestor` while your xpath uses `Requester`. Could that be the reason? – Jack Fleeting Mar 08 '20 at 16:12
  • @JackFleeting Thank you, I changed it, but the error remains. Another strange thing, I don't understand why after typing "$Tasks." and see available parameters, all the parameters belong to the Administration.Account entity, not to the Tasks entity. – Rumata Mar 08 '20 at 16:21
  • Please read [Under what circumstances may I add “urgent” or other similar phrases to my question, in order to obtain faster answers?](//meta.stackoverflow.com/q/326569) - the summary is that this is not an ideal way to address volunteers, and is probably counterproductive to obtaining answers. Please refrain from adding this to your questions. – halfer Mar 08 '20 at 23:13

1 Answers1

1

Rumata, the right way to access the parameter's/object's attributes is using '/' symbol instead of '.' symbol. When you type / as shown below you will be shown all the attributes if 'Tasks' instead of Administration.Account entity.

[Name = $Tasks/Requester]

The '.' symbol is used only when trying to access an enumeration's value in a if statement or exclusive split.

Example: variable1 = module.enumname.value