Count attribute number instead of the entity

Usually when we use count in microflow, on retrieved list from database it retrieves the count for number of entries for that entity. In my case, i have employee entity and mobile attribute. I need to validate in mf, that the mobile number if used for one employee shouldn’t be used for another. In MF, i retrieve list of employee. How do i retrieve list of mobile numbers too and add count related validations to throw error if mobile exists for other employee?
2 answers


Loop though the list which is retrieved from database

Inside loop, retrieve from database using the following xpath



If the object is empty, then Mobile Number is unique

If the object is not empty, then Mobile Number already exists


Hope it helps!!!


Hi Pragya,

I don't think you need to use a count action here. You can use a database retrieve on Employee where you check the following things:

[Mobilenumber = $employee/Mobilenumber]

[id !_ $employee/id]

This way you can check if the mobile number is already used for another employee.

Hope this helps!