= if( /* Do we need to add?*/ and( not( isnull( ri!value ) ), /* Yes, if the value isn't null*/ ri!index = 1 + length( ri!array )/* and we're at the end of the list*/ ), append( ri!array, ri!value/* Add: Append the new value to the end of the list*/ ), if( /* Do we need to remove?*/ isnull( ri!value ), /* Only if value is now null (value was removed)*/ remove( ri!array, ri!index ), /* Remove: remove the list item for this field*/ insert( /* Neither add nor remove, so insert at index*/ ri!array, ri!value, ri!index ) ) )