Dynamically change member of Change Object activity

Problem Description I have a nanoflow where I repeatedly need to change members of an entity. Currently, I have multiple Change Object activities, each hardcoded to modify a specific member. The overall structure of the flow is going to be exactly the same for all members. I'd like to make this process more dynamic so that I can pass an attribute name as an input parameter to the nanoflow, eliminating the need to create separate nanoflows for each member. The standard Change Object activity doesn't allow directly selecting the member using a variable.   A view of ONE of my nanoflows - Meaning I need to edit 6 "Change Object" activities for EACH of the members. I am going to have to do this for at least 10 members, so keeping track and managing changes in the overall structure is going to be a nightmare.   If I have to create a nanoflow for each member, it's going to become unmanageable.   What I've Tried I researched ways to dynamically modify the selected attribute/member in nanoflows/microflows but haven't found a straightforward solution within the standard activities. Desired Solution I'm looking for guidance on the most efficient way to achieve this. I'd like to know if there are: Any workarounds using standard Mendix activities that I might have overlooked. Techniques to implement dynamic attribute selection (e.g., Decision activities, JavaScript actions). Additional Context I'm comfortable with Mendix development. I'm open to using JavaScript actions if that provides the best solution. Thank you in advance for your insights!
2 answers

Hi Prontus,

Did you try creating an Enum variable and writing an if-else condition there??

and then setting the value based on the Enum?


Or maybe we can connect through google meet??


Let me know?

Hope it helps!




I'm not sure where you want me to use the Enum, because nowhere in the "Change Object" dialogue can I put a dynamic value:



This image is just to further clarify the thing that I want to dynamically change.


Depending on a parameter of the flow itself, I want to change the member from NewAddressValidated to PrevAddressValidated (for example).


A practical example of the way of working I envision is: When I call the flow - I want to set the MemberToChange parameter to the member name, which in this case would be either "NewAddressValidated" or "PrevAddressValidated", and depending on which member I choose as the parameter, I can bind this parameter to the Change Object activity.


Thank you.