Map transformation with dynamic keys

a!localVariables(
local!map1: {
    a!map(Id: "Map 1", key1: "A", key2: "C", key3: "C"),
    a!map(Id: "Map 2", key1: "C", key2: "A"),
    a!map(Id: "Map 3", key1: "C", key2: "B", key3: "C")
},
local!map2: a!map(
     Key1: "ky1", 
     Key2: "ky2",
    Key3: "ky3"

/*This list can be very long e.g. Key4: "ky4", Key5: "ky5" etc.*/

),
/*code here*/


/*desired output starts - swap the keys based on mappings in map2 */
/*
{
   a!map(Id: "Map 1" , ky1: "A", ky2: "C" , ky3:"C"),
   a!map(Id: "Map 2" , ky1: "C", ky2: "A"),
   a!map(Id: "Map 3" , ky1: "C", ky2: "B" , ky3:"C"),
}
*/
/*desired output ends*/

/*Is it possible ?*/

)

  Discussion posts and replies are publicly visible

Parents Reply Children
No Data