Problem with the result of ER

Hello, 

I would need the result of this Expression Rule in cod_provincia show me only the code of the provincia to which the municipio belongs. However, it is returning all the codes from my provincias table. 

What am I doing wrong?

Thanks in advance. 

  Discussion posts and replies are publicly visible