Change referenced object for dynamic bar chart

0
Hi all, I would like to create a dynamic bar following this how-to: https://docs.mendix.com/howto7/extensibility/charts-dynamic-series   I got these two entities for the charts data: It works great as long as connect the Objects the value entity to a certrain series manually by reference selector.   Now I would like to connect the charts data (Value entity) and series by a microflow and not manually by a reference selector in the app. Lets say I want to assign all  Value objects to “First Series” of series/Name attribute. How can I achive that in a microflow?  I created a variable which contains “First Series”. Due to the series entity is a different entity, I am not able to change that attribute in the Value Object.  Looking forward to your ideas :)
asked
2 answers
1

In your microflow, if you have a list of Value objects and you have a Series object, you can loop through the list of Value objects.  In each iteration, you will want to change the value of the association Value_Series and set it to the Series object you have.

One note:  if your list of Value objects is large (hundreds or thousands or more), the best practice is to not commit those objects inside the loop.  Instead, change them in the loop without committing or refreshing in client and then after the loop, commit the whole list with on Commit action.

answered
0

Hi Mike,

great that worked!

Many thanks :)

One more thing: If I do not commit the NewValue Objects in the Loop and put the commit of Value entity after the loop the objects are empty… how cant i fix that? It only works if I commit inside the loop.

answered