How to set properties in a List of objects without knowing the schema

During development or because of future changes to the object properties, I was trying to capture the properties of an object, go through each object property and set it to a value. This use case is to set 1 property to a unique id read from another object and then set all the other properties to 0.

I was attempting to read the keys and use each one to update all the properties so I would not have to modify this init routine when the properties were added or deleted.

Flow Function setAppVar (appVars.myObjList)

Formula mock
MAP <rs> (appVars.OtherObjList,
MAP <properties> (KEYS (appVars.myObjList [0]),

set the id property from key/vaue from OtherObjList and
set all other properties in appVars.myObjList to 0.

))

SET_KEY does not work because it returns the entire object each time and concatenates all of the objects over and over.

I tried to build the object with
IF(property==id, property: otherObjList.id, property: 0) and that did not work. I put { } around the values inside and outside the MAP function any number of ways and did not get a valid { } build.

I would think this is simple, but I am not getting it.

Any suggestions? thank you