Change Value of all Elements from List
257
Views
2
Comments
New
Builtin & User functions

There could be an Action that would change the value of an attribute for all elements of a List, avoiding iterating/cycling (For Each) every single element of the List.

eg: Having a List with an attribute "IsActive". Setting all elements' Is Active from the List to False, would need a For Each.

Hello Pedro,

It looks like a nice ideia.

I´m not an expert in javascript, maybe create something like the "map" method.

Something like this:

const employees = [

    { name: 'Nuno', isActive: '' },

    { name: 'Pedro', isActive: '' }

]

const employeesNew = employees.map(function(row) {

   return { name: name, isActive: true }

})

is a good idea, today we have the list append all that puts everything in the list and we could have this one of yours