How to implement count in x-path in Mendix..

-1
How to implement count in xpath .
asked
3 answers
5

Hi Manoj,

I see you just started out with Mendix. That's great! Some pointers though:

1. Most of your questions can be answered quite easily by following the Mendix Getting Started tutorials, which you can find here: https://gettingstarted.mendixcloud.com/link/path/10

2. What have you tried to do already before asking the question?
Try to search the forum for answers first, search the reference guide (https://docs.mendix.com/refguide)

3. Mendix XPath is an interpretation of standard XPath and doesn't contain the count function.
Also see my post here on Mendix XPath: https://forum.mendix.com/link/questions/8840

What you can do (based on your answer to Austin) is to make a microflow with two actions:

1. Retrieve from Database:
Retrieve type = Employee
XPath constraint = [Status = 'Active']

Output = List
Name = ActiveEmployeeList

2. Aggregate List:
Variable = ActiveEmployeeList
Function = Sum

Output = CountActiveEmployees <= this is what you were looking for with the XPath Count operation.

Good luck!

Kind regards,
Jeffrey

answered
1

Are you trying to limit the number of objects returned? In your retrieve activity you can set the limit to achieve this.

Here is some documentation on this

https://docs.mendix.com/refguide/retrieve

and a blog post

https://www.mendix.com/blog/limits-and-offsets/

 

If you are trying to count the number of returned objects, use the aggregate list activity after your retrieve to count the  list.

answered
0

try this : https://docs.mendix.com/refguide/xpath-count

 

answered