loop through property names - Mendix Forum

loop through property names


in every other programming language you can loop through an objects properties, in mendix you can only loop through a list that returns an object.

Once I have that object, if I can loop through the property names, I can then more dynamically set each value, or make a decision if one is empty.

2 answers

If you loop through properties, properties are strings. This is possible as key value pairs and would be the same as getAttributes() function of an object. The point would be to do it in a stock fashion inside a microflow to make something “low-code”.

I have done it in javascript as well, but unfortunately for my current work task this will not work. 

My purpose is to help others in our company to adopt Mendix for rapid development, and most of them use excel and do not program so using a java action isn’t much of an option for them.


Since you don’t have generic Objects in Mendix, that might be difficult. If you have strings, decimals, booleans,… which type should your iterator be off?

You can already do this in a java action. If you pass your object (and you can use a generic object) to a java action, you can loop over the attribute list.