I want to create a virtual field in an entity Ciudade for use it in setDisplayField in Ciudadestable… But I need acces the nombre_departamento located in Departamentos table.
Your question isn’t specific enough. Is Ciudade linked to Departamentos (belongsTo, hasMany, etc). If linked, then just add a contain and use something $this->Departamentos->nombre_departamento
Maybe calling TableRegistry::getTableLocator()->get('Departamentos'); to get the table, and then get your data.
An alternative. Maybe the formatResults feature may help you. Docs