Skip to main content
Participant
Oct 11, 2024 1:30 PM UTC
Question

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

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 is closed to new replies. Start a new post to keep the conversation going.

    1 reply

    Raymond Camden
    Community Manager
    Community Manager
    Oct 11, 2024 1:44 PM UTC

    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.

    Translate