How to save custom label as parameter for a custom entity_reference field widget? I am creating a custom field widget for an entity_reference field. This has a custom select field and an Ajax Submit button. Once the user selects an option (entity) from the select_field and submits it, I am adding the entity in a dragTable below. 

I could achieve that until now, but my need is to add a custom label for the entity selected. I provided a textfield to capture the custom values and I am able to fetch the values. But, I am unable to save this custom text_field data. I am extending the core WidgetBase class for my custom field Widget.
For an entity_reference field, is it possible to save custom label parameters along with the entities?



Updated:
After enabling fieldType, duplicate results are appearing while creating field. Any help on this? .
You need to create a custom field type that can hold the value along with the entity reference.

A field widget can not store any data that the field type has not provided space for.

You must create a new field type would look similar to this:

&lt;?php

namespace Drupal\MY_MODULE\Plugin\Field\FieldType;

use Drupal\Core\Field\FieldStorageDefinitionInterface;
use Drupal\Core\Field\Plugin\Field\FieldType\EntityReferenceItem;
use Drupal\Core\StringTranslation\TranslatableMarkup;
use Drupal\Core\TypedData\DataDefinition;

/**
 * @FieldType(
 *   id = "entity_reference_with_value",
 *   label = @Translation("Entity reference with value"),
 *   category = @Translation("Reference"),
 *   default_widget = "my_custom_field_widget",
 *   default_formatter = "some_formatter",
 *   list_class = "\Drupal\Core\Field\EntityReferenceFieldItemList",
 * )
 */
class EntityReferenceWithValue extends EntityReferenceItem {

  /**
   * {@inheritdoc}
   */
  public static function schema(FieldStorageDefinitionInterface $field_definition) {
    $schema = parent::schema($field_definition);
    $schema['columns']['value'] = [
      'type' =&gt; 'varchar',
      'length' =&gt; 255,
    ];
    return $schema;
  }

  /**
   * {@inheritdoc}
   */
  public static function propertyDefinitions(FieldStorageDefinitionInterface $field_definition) {
    $properties = parent::propertyDefinitions($field_definition);
    $properties['value'] = DataDefinition::create('string')
      -&gt;setLabel(new TranslatableMarkup('Value'))
      -&gt;setRequired(TRUE);

    return $properties;
  }

}


Now you can get the value with $entity-&gt;field_name-&gt;value.

It would also be better to extend EntityReferenceAutocompleteWidget in your field widget, instead of WidgetBase. Then you can just do like this in the formElement method:

public function formElement(FieldItemListInterface $items, $delta, array $element, array &amp;$form, FormStateInterface $form_state) {
  $widget = parent::formElement($items, $delta, $element, $form, $form_state);

  $widget['value'] = [
    '#type' =&gt; 'textfield',
    '#title' =&gt; $this-&gt;t('Value'),
    '#default_value' =&gt; $items[$delta]-&gt;value,
    '#weight' =&gt; 999,
  ];

  return $widget;
}