Possibility to retrieve a single object based on a ROW NUMBER or an INDEX from a list - Mendix Forum

Possibility to retrieve a single object based on a ROW NUMBER or an INDEX from a list

1

For retrieval, there is only one option of retrieving the first object. This is highly inconvenient, as in order to retrieve a object with a specific condition there is no feasible method whatsoever. 

For ex: I want to run a loop on one list A and retrieve object from list B on each iteration based on some index/row number, or for that matter Xpath. This cannot be done.

If I select CUSTOM and do set the AMOUNT=1, the output type still remains as LIST of some type.

Even in Xpath there is not an option to retrieve a single object based on condition. 

 

Kindly, please deliberate on this. Thank you.

asked
4 answers

Hi Rick,

 

Unfortunately, the first option simply is not feasible as there is no Xpath function that will give the current row number of an object.

Created

Hi @Chandresh

 

Could you help me understand how I would acquire an index of an object?

Also please name this java action so I can try it out.

 

Thank you!

Created

I did write a Java action which exactly does this 

pass the list and index to hjava action and return one object on that index

Created

Hi,

 

If you want to retrieve an object in a loop you can simply set the range to first and build an Xpath that retrieves your specific object. Otherwise retrieve your list and use the list operation tools to filter or find the object that you are looking for. The first option wil be the best.

Created