the way to enable key spec here is to do something like:

${$record->guess_key_from_spec($field)} = $item->{field};