Welcome to Community Week 2025! Join us to learn, connect, and be recognized as we celebrate the spirit of Community and the power of AI. Get the details  

Document Preview question about Generate / Regenerate regarding the use of multiple templates

Community Alums
Not applicable

Hello Community,

 

My use case: I want to use the document preview and generate multiple attachments. However, when I try this, I am presented with the 'Regenerate' button, which overwrites the 1st attachment.

 

Anyone know how this button decides to show up? Is there a way where we can expose the 'Generate' button? Would that even work? Is there an approved method for when using multiple document templates to one case?

 

In my testing I tried this, and it works to not overwrite it, but it's cumbersome:

  1. Load the 1st template into the document template field.
  2. Preview the document.
  3. Generate the 1st template.
  4. Download the 1st attachment.
  5. Delete the 1st attachment from the case.
  6. Attach the downloaded version of the 1st attachment.
  7. Load the 2nd template into the document template field.
  8. Preview the document.
  9. Generate the 2nd template.
    • Note here that the 'regenerate' button is not showing up after I manually attached the 1st template.
    • I wish to understand why it shows up, what is the link? Can it be broke or manipulated?
1 ACCEPTED SOLUTION

michaelj_sherid
ServiceNow Employee
ServiceNow Employee

@Community Alums  This "regenerate" is presented because the draft document is created. Your use case is not "configurable" out of the box due to the functionality where only one document template can be called for a specific HR Service. There are configurable ways to change the (Document) template dynamically, but the Out of the Box workflow will only allow one attachment based on the selected document template for the HR Case. We have some OOTB examples of multiple documents (if you look at the Onboarding Activity of Employee Documents) where this has a main HR Service with child HR Services, each of which have a separate Document Template. You can see there are a few script includes involved, but for HR Document Templates, the magic happens in the script include - GeneralHRForm. It is not a recommendation to modify the OOtB script includes, but interested in the use case to understand if there is another way to configure this.

 

If my answer has helped with your question, please mark my answer as an accepted solution and give a thumbs up.

Regards,

Mike

View solution in original post

5 REPLIES 5

Community Alums
Not applicable

Hi @abirakundu23,

I appreciate the reply. I had wished to understand the relationship between this 'regenerate' button and the attachment that was generated. Your explanation on this did not yield any new information. The core of my question would be: Why is it that when you delete the generated attachment, and upload an identical one, the relationship between the preview and attachment breaks, so when you use 'preview document', it'll display the 'generate' button instead of the 'regenerate' button?

 

I have conveyed the suggestions from this forum to the required parties and they are now discussing their best course of action. I also provided them with the workaround I had found, though cumbersome, does work so that you can get multiple attachments while leveraging different templates all in a single case.