Variable of type Object - Mendix Forum

Variable of type Object


Hi !

Today variables can’t refer to Object, and it would be very useful.

For example in a microflow with following algorithm :

  1. try to retrieve an Object → named “ExistingX”.
  2. if “ExistingX” is empty, create a new object named “NewX”
  3. then, whatever we want to do, it has to be duplicated both for “X” and “NewX” (it’s not possible to merge the flow into a single one)

If it was possible to define a variable of type Object, then it would be possible to do :

  1. Create an undefined variable of type Object named “X” 
  2. Try to retrive “ExistingX”
  3. If ExistingX is not empty, update the value of “X” with “ExistingX”
  4. Else, create “NewX”, and update “X” with “NewX”
  5. Then, merge the flows into 1, and use “X” onwards
0 answers