How to map a taxonomy term into Feeds Importer? I have several Blank sources in a Feed and I'm mapping a value to these blank sources in my custom code.

I have a working example to set a value of a field of type 'TEXT FIELD':

function set_profile_value(FeedsSource $source, $entity, $target, array $values, array $mapping) {
    if (substr($source-&gt;id, 0, 7) == 'my_data') {
        if (!empty($mapping['profile'])) {
            $entity-&gt;{$target}[$entity-&gt;language][0]['value'] = $mapping['profile'];
        }
    }
}


My question is, how to do the same if the field is a term reference?

Thanks!
It was simpler than what I thought.

The code is exactly the same, but instead of 'value', we have to use 'tid':

function set_profile_value(FeedsSource $source, $entity, $target, array $values, array $mapping) {
    if (substr($source-&gt;id, 0, 7) == 'my_data') {
        if (!empty($mapping['profile'])) {
            $entity-&gt;{$target}[$entity-&gt;language][0]['tid'] = $mapping['profile'];
        }
    }
}