$tv = $modx->getObject('modTemplateVar', array('name'=>'TestTv')); $id = 12; // $ID of resource; $tv->setValue($id, 'NewValue'); tv->save();
it’s correct,you just forgot the $tv->save() at the end