It doesn exist because you've just deleted it, however, you have an activity after it still referencing it. In this case, you still need to loop all records and check if any of them contain a value for your column before you execute the column removal. something like below. var query = xtk.queryDef...