Show fields and save ID in dropdown menu

Show fields and save ID in dropdown menu

In a form I have a lookup field called Dipendente (form Dipendenti) that contain ID field but is displayed as "Name Surname" (Advanced display options).
This lookup field is child of another field ( Cooperativa). When I select the Cooperativa, the child field show only filtered records.
It works fine but when filtered the field Dipendente I see ID field and not "Name Surname".
I want view "Name Surname" and save ID.

Thank you


This is the code for Cooperativa field:

  1. on user input
  2.             {
  3.                 if (count(Dipendenti[Cooperativa == input.Cooperativa])  ==  0)
  4.                 {
  5.                     clear Dipendente;
  6.                 }
  7.                 else
  8.                 {
  9.                     listanominativi  =  Dipendenti  [Cooperativa = input.Cooperativa] sort by  Cognome ;
  10.                     Dipendente:ui.add(listanominativi.ID.getall());
  11.                 }
  12.             }