File Field description field default using tokens? Using Drupal 8 File Field and enabling the optional description field works normal.  

I want to have a default value populated for the field using tokens from other fields in the content type (to create a standard formatted description).  Is there a way to enable this or must I disable this field and override the twig for the content type to display the desired description for the file link?  

Note that this question pertains the optional description field (not the filename - that works perfectly well with the tokens using File (Field) Paths module.)
Good news - it's not that hard!  Here's what you need to do:


Install Drupal Console (if you haven't already): https://drupalconsole.com/
Install the devel module: https://www.drupal.org/project/devel
Enable the webprofiler module (part of devel) drush en webprofiler
Webprofiler adds a toolbar to the bottom of your browser window.  Use this to get the form ID of the form you want to modify.
Use Drupal Console to generate a hook_form_FORM_ID_alter() function.  You'll need either a custom theme or a custom module for this.


Warning: If you're modifying the node edit form, it probably uses the admin theme.  You probably don't have a custom admin theme, so you may want to put this in a custom module.

Customize your function to prepopulate the field the way you want.  Here's what I did:

use Drupal\Core\Form\FormStateInterface;

/**
 * Implements hook_form_FORM_ID_alter() on behalf of coit_customizations.module.
 *
 * Provides a default for file description on meeting edit form
 */
function coit_customizations_form_node_meeting_edit_form_alter(&amp;$form, FormStateInterface $form_state, $form_id) {
  // Check to see if there's already a file description
  $existing_description = $form['field_supporting_documents']['widget'][0]['#default_value']['description'];

  // If there isn't, add the default
  $new_description = $existing_description ? $existing_description : 'Download Supporting Documents';
  $form['field_supporting_documents']['widget'][0]['#default_value']['description'] = $new_description;
}

Don't forget to enable your module!


For further reading:


http://enzolutions.com/articles/2016/02/01/form-altering-will-not-be-the-same-in-drupal-8-after-using-webprofiler/
How to change a field&#39;s description using hook_form_alter in Drupal 8?
https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Core%21Form%21form.api.php/function/hook_form_alter/8.4.x
https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Core%21Form%21form.api.php/function/hook_form_FORM_ID_alter/8.4.x


One last tip: xdebug is very useful for inspecting your form array so you know what to customize.  If you're trying to do this kind of thing and aren't using xdebug, I recommend you check it out.  

As an easier alternative, just add this to your function: drupal_set_message($form);