Base Rule ===================================== with( local!indexOfField:wherecontains( ri!field, ri!listOfFields ), if( or( isnull(ri!field), rule!APN_isEmpty(ri!valuesForTheField) ), {}, choose( local!indexOfField, {a:ri!valuesForTheField}, {b:ri!valuesForTheField}, {c:ri!valuesForTheField}, {d:ri!valuesForTheField}, {e:ri!valuesForTheField} ) ) ) Update CDT At Given Index ==================================== updatecdt( ri!cdt, ri!fieldAndValue ) Main Rule ===================================== load( local!test: { { a: 1, b: 2,c: 3,d: 4,e: 5}, { a: 11,b: 12,c: 13,d: 14,e: 15}, { a: 21,b: 22,c: 23,d: 24,e: 25}, { a: 31,b: 32,d: 34,e: 35}, { a: 41,b: 42,c: 43,d: 44,e: 45} }, local!fieldsAndValues: apply( rule!baseRule( field: _, valuesForTheField: _, listOfFields: { "a","b","c","d","e"} ), merge( { "b","d","e" }, { 52,54,55 } ) ), reduce( rule!updateCdtAtGivenIndex, local!test[ri!index], local!fieldsAndValues ) )