var retList = arguments.currList; // Handle the ADD action if ( arguments.actionType EQ "add" ) retList = ListAppend(retList, arguments.currItem); else if ( arguments.actionType EQ "remove" ) { // Handle the REMOVE action // Check if the value is in the list if ( ListFindNoCase(retList, arguments.currItem) ) { retList = ListDeleteAt(retList, ListFindNoCase(retList, arguments.currItem)); } }