bulk update object attributes in a datagrid

0
Hello,   I would like to bulk update attributes of objects in a datagrid list through microflow. For this, I created a button on my datagrid to show a modal page with an object as page paramater and the fields i would like bulk updated which will be inputted by the user.   Issue: when passing this page paramater to my microflow I get an error because the page which captures the data to do the bulk update with is an object, and i would like to iterate over the datagrid list to apply these values to all selected objects in this list.   How could I achieve this?    
asked
4 answers
2

Hi Eson,

Your problem is that you have the list before opening the data view page, but at that moment you only have 1 single object left. So when you then say that you want that list to have all the same value, you need to ensure the list you want to change is taken into the flow from the data grid up until the conversion flow on the save button of the newedit page. 

 

The easiest way to get this to work is to first give the input value and then select also to what other objects it applies, because then you already have the value to change to, and you just need to select to which objects it applies. So you first do the input and then select the list.

 

A harder and less convenient and performing way is to fix this, is to use a NPE (f.e. _MileageAllowanceHelper) which you then association to MileageAllowance (use *-* as 1-* is not allowed that direction). Then the _MileageAllowencesHelper holds the association to the complete list of MileageAllowance you want to change. 

Then in the on save microflow, you can retrieve the list of MileageAllowance and write the MassChangeMileageAllowence atribute to the desired attribute.

answered
5

Hi Eson,

You needs to create a NPE and associated with MileageAllowence (1 to *) in data grid action call a microflow with selected list object as parameter 

in that microflow create a NPE object and map the list with this object and do the same as mentioned above show popup page get the values in NPE object 

in submit flow retrieve the MileageAllowence form NPE object and perform your action.

 

Thanks.

answered
1

Hi Eson,

 

I think you are forgetting to set the list (the input parameter) as the associated list in the Create action on the _MileageAllowenceHelper (in the first flow).

Please check an example project here for a working solution. 

answered
0

Hey Bob,

 

Thanks for this, it defiinetly works! I’ve eventually came to the conclusion that i will have to build all the existing logic which is behind the initial object on save in the loop to be able to allow bulk updates.

 

I’ve noticed than when i create my NPE, the list contains the selected datagrid objects with its attribute values. However when i retrieve the helper in the followup microflow it seems to only pass the data inputted by the user in the newedit page.

This would not allow me to run calculations on earlier inputted data in the list without having the user copy over existing values in the newedit page. Is there a way to bypass this issue?

I appreciate all the help, thanks.

 

Eson

 

 

answered