diff -u b/modules/salesforce_mapping/src/Plugin/SalesforceMappingField/Token.php b/modules/salesforce_mapping/src/Plugin/SalesforceMappingField/Token.php --- b/modules/salesforce_mapping/src/Plugin/SalesforceMappingField/Token.php +++ b/modules/salesforce_mapping/src/Plugin/SalesforceMappingField/Token.php @@ -82,11 +82,12 @@ * */ public function value(EntityInterface $entity, SalesforceMappingInterface $mapping) { - // Even though everything is an entity, some token functions expect to - // receive the entity keyed by entity type. $text = $this->config('drupal_field_value'); - $data = ['entity' => $entity, $entity->getEntityTypeId() => $entity]; - return $this->token->replace($text, $data); + $data = [$entity->getEntityTypeId() => $entity]; + $options = ['clear' => TRUE]; + $result = $this->token->replace($text, $data, $options); + // If we have something, return it. Otherwise return NULL. + return (trim($result) != '') ? $result : NULL; } /**