Ok here is one way to do it does however involve creating a custom twig Extension. its not to hard and there are a few youtube videos on the subject ...
for others it is good to note that custom Twig Extensions has replaced php input fields in older versions of Drupal.
in a nut shell you create a custom module,
you add a MODULENAME.services.yml file.
in it you put...
services:
modulename.getWebformDescription:
class: Drupal\modulename\getWebformDescriptionTwigExtension
arguments: ['@entity_type.manager']
tags:
- { name: twig.extension }
then you need here is your class file (getWebformDescriptionTwigExtension.php)
<?php
namespace Drupal\modulename;
use Drupal\Core\Entity\EntityTypeManagerInterface;
/**
* Provides twig function getWebformDescription()
*/
class getWebformDescriptionTwigExtension extends \Twig_Extension {
/**
* Load entity type manager.
*
* @var EntityTypeManagerInterface
*/
protected $entityTypeManager;
/**
* {@inheritdoc}
*/
public function __construct(EntityTypeManagerInterface $entity_type_manager) {
$this->entityTypeManager = $entity_type_manager;
}
/**
* {@inheritdoc}
*/
public function getName() {
return 'getWebformDescription';
}
/**
* {@inheritdoc}
*/
public function getFunctions() {
return [
new \Twig_SimpleFunction('getWebformDescription',
[$this, 'getWebformDescription'], [
'is_safe' => ['html'],
]),
];
}
/**
* Provides getWebformDescription function to Twig templates.
*
* Use example {{ getWebformDescription( webfrom_id) }}.
*
* @param string webfrom_id
* The webform id eg 'contact'
*/
public function getWebformDescription($webfrom_id) : string {
// Invoke __toString and cast to int.
$webfrom_id = $webfrom_id->__toString();
$webform_storage = $this->entityTypeManager->getStorage('webform');
$webform = $webform_storage->load($webfrom_id);
return $webform->get('description');
}
}
after all that is done and the module is enabled you can then in views add the webform id field (and exclude it from display)
then add a new custom field and look at the replacement patterns you will see
some thing like {{webfrom_id}} ...
in that field you can then enter ...
{{ getWebformDescription(webfrom_id) }}
if stuck
see stuff like https://medium.com/@thihathit/extending-custom-twig-extension-to-drupal-8-twig-extension-class-d4b99c2177ae
or google "create custom twig extension for drupal 8"