Count attribute number instead of the entity

0
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?
asked
2 answers
4

Hi,

Loop though the list which is retrieved from database

Inside loop, retrieve from database using the following xpath

[id!=$IteratorDetail]
[MobileNumber=$IteratorDetail/MobileNumber]

 

If the object is empty, then Mobile Number is unique

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

 

Hope it helps!!!

answered
2

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!

answered