Skip to main content
Participant
October 11, 2024
Question

When field not found in body the variable is left in document

  • October 11, 2024
  • 1 reply
  • 304 views

Generate document from Word template

 

Between August 12th and August 15th 2024 my reports started leaving variables where a field was not found in the body.

 

My body only includes fields with values, prior to this change the variablelike , {{feature.attributes.`fcomments`}}, would be removed if the field was not found (due to a null value).  Now my report keeps the variable {{feature.attributes.`f_3comments`}} .

 

Seems like something has changed on Adobes side.  Do I now need to add logic to check to fields?

    This topic has been closed for replies.

    1 reply

    Raymond Camden
    Community Manager
    Community Manager
    October 11, 2024

    For now, yes, perhaps just quickly setting to "". I *kinda* remember some internal discussion on this. Another option is to use a default value in the tag itself, see Default value here: https://developer.adobe.com/document-services/docs/overview/document-generation-api/templatetags/#tag/Import-PDF-Form-Data/operation/pdfoperations.setformdata.jobstatus (or optional)

     

    What I don't see in the docs is a clear, "we do so and so if the value is not there." Nor do I see a release note concerning this if indeed it was intentional. I'll file an issue internally to document this, and if we did change it, to remind us to note such stuff.