Retrieve and compare reference seleted variables

I have three entities in which entity 1 and 2 use a reference selector to choose an input (Name) from entity 3. In entity 1, users also must indicate a score (type float). In entity 2 I want to give an average of this score, but only for the situations in which the 'Name' for entity 1 and 2 is the same. How do I manage to retrieve the right scores? Retrieving in a list where I set the XPath constraint (via the associations) that both the Names must be equal seems not to work. This also leads me to the question, where are the values stored from a reference selector; how can I retrieve them easily in a microflow? Thanks, Mark
1 answers

You shouldn't use names (since there can be duplicates / misspellings), instead use the reference to the object (the reference is a GUID). The reference is stored in your object and you can check if the references point to the same object.

If your microflow has no input objects:

  1. Retrieve all objects of Entity3
  2. Loop over all objects of Entity3
  3. For an object of Entity 3, retrieve a list of objects of Entity2
  4. Loop over all objects of Entity2
  5. Retrieve all objects of Entity1 where [Entity1_Entity3 = $IteratorEntity2/Entity2_Entity3]
  6. Use a ListOperation Average on Entity1/Score
  7. Store AverageScore in Entity2
  8. Commit

If your microflow has an input object of Entity2, you can skip steps 1. through 4.