autocomplete textfield displays value instead of label after click

Hello. I’ve created a custom handler for an autocomplete textfield, in a form. this is the code : public function handleAutocomplete(Request $request) { $result = []; $query = Drupal::database()->select(‘site_entity_field_data’,’s’); $query->fields(‘s’, [‘id’, ‘name’]); $entities = $query->execute(); foreach ($entities as $entity){ $field_site_id = $entity->id; $field_name = $entity->name;[…]