Change attribute in a list directly - Mendix Forum

Change attribute in a list directly


In the case you want to set an attribute for every attribute in the list, it is required to create a loop to iterate over the list, update the attribute, and commit afterward. Would it be nice to at once?


Save clicks a, remove complexity and make the microflow easier to read.


5 answers

This is very good idea. I agree with Wouter that this is not increasing the readability, but it could definitely gain in performance. In fact, the two activities should be combined into one SQL-statement like “UPDATE module$entity SET attribute… WHERE ...” such that the runtime engine is not bothered with the actual list of objects, just like the List aggregate activities.


Even better is to combine the retrieve list and the update action. Then you do not have to retrieve the list into the Mendix Runtime memory


I think this would be a useful feature, since instead of processing the feature in the Mendix runtime in a loop, which might be problematic if the list is large, the processing could be taken to the DB (if Mendix compiles it as UPDATE Entity SET ‘value’ WHERE condition).

As for readability: I don’t see how looping around a change object is better readable than a single activity that tells me a list is being changed (one clumsy loop visualization and one activity from which the reader has to infer that a whole set of objects is changed iteratively vs. only one single activity that immediately tells you a whole list is changed). 

Moreover, I don’t see why the sole frequency of a case should be decisive for the realization of a feature. It tells you nothing about the importance of these cases. If it is indeed a useful feature, the frequency of the cases where it is needed should only affect the priority on the feature list but not whether it should be added to this list.


Hi Andries,

I don’t see why this should be added. In only a few cases you want to set one specific attribute.

Nor do I see how this would increase the readability of a microflow.