•The GDPR introduces a duty for you to appoint a data protection officer (DPO) if you are a public authority, or if you carry out certain types of processing activities.
If you are a public authority or if you carry out specific type of activities you have a duty to appoin DPO.
[DPOs Role]
[DPO responsiblitiy]
Furthermore Spain has their own requirement of appointing the DPO.
http://www.agpd.es/portalwebAGPD/temas/certificacion/common/pdf/SCHEME_AEPD_DPD.pdf