When catalog item is submitted, attach variables to RITM as a PDF

AngusWIlliams
Tera Contributor

Hi,

 

I am looking for a current way, on RITM creation, to generate a PDF containing the variables of the catalog item submitted, and then attach this to the RITM.  I've seen the PDFGenerationAPI, and am aware this is a good way to go about it, but I don't have too much experience with scripting in this way. Does anyone have any code snippets to accomplish this or something similar? I especially want to add the display values to the PDF and not the underlying values.

Many thanks,
Angus 🙂

1 ACCEPTED SOLUTION

Robbie
Kilo Patron
Kilo Patron

Hi @AngusWIlliams,

 

Can I ask the requirement or need for the variables to be attached as a PDF document? 

It is common practice to simply configure the form layout and add a new form section and tab displaying the variables. These can be read only (Recommended).

This allows 'fullfillers' or service desk task managing the requests to see exactly what a user has entered? Would that not suffice and provide an easier solution for all without the need for attachments etc.

 

- Open the Requested Item form.

- Right-click at the top and select 'Configure > Form Layout'

- At the bottom of the form under the slush bucket (as pictured below) - Click on 'New...' to create a New form section and tab. Call it variables for example. - Hit Save.

- With that new form section highlighted, look for the field called 'Variable Editor', and double click it to move it from the left side to the right - again as show below.

- Hit Save - you now have your variables on the form for everyone to see.

- (I'll find a script for you so you can make them read-only)

 

To help others (or for me to help you more directly), please mark this response correct by clicking on Accept as Solution and/or Kudos.

 

Thanks, Robbie

 

Screenshot 2024-04-29 at 14.27.30.pngScreenshot 2024-04-29 at 14.28.21.pngScreenshot 2024-04-29 at 14.28.55.png

View solution in original post

6 REPLIES 6

Simran Gadodiya
Mega Sage

Hi @AngusWIlliams 


Hope this helps you, if helps mark it as accepted solution and helpful so it will help others as well.
https://www.servicenow.com/community/developer-forum/pdf-generation-in-geneva/m-p/1751071

 

Thanks.

Robbie
Kilo Patron
Kilo Patron

Hi @AngusWIlliams,

 

Can I ask the requirement or need for the variables to be attached as a PDF document? 

It is common practice to simply configure the form layout and add a new form section and tab displaying the variables. These can be read only (Recommended).

This allows 'fullfillers' or service desk task managing the requests to see exactly what a user has entered? Would that not suffice and provide an easier solution for all without the need for attachments etc.

 

- Open the Requested Item form.

- Right-click at the top and select 'Configure > Form Layout'

- At the bottom of the form under the slush bucket (as pictured below) - Click on 'New...' to create a New form section and tab. Call it variables for example. - Hit Save.

- With that new form section highlighted, look for the field called 'Variable Editor', and double click it to move it from the left side to the right - again as show below.

- Hit Save - you now have your variables on the form for everyone to see.

- (I'll find a script for you so you can make them read-only)

 

To help others (or for me to help you more directly), please mark this response correct by clicking on Accept as Solution and/or Kudos.

 

Thanks, Robbie

 

Screenshot 2024-04-29 at 14.27.30.pngScreenshot 2024-04-29 at 14.28.21.pngScreenshot 2024-04-29 at 14.28.55.png

Hi Robbie,

Thanks for this. We do have this added to the form, but were wondering if there were additionally a simple way to attach them as a PDF, but we can ask fulfillers to simply download the form as a PDF if needed.

Many thanks,

Angus

Why would it ever be necessary to have the variables as PDF? You are working in the system, the variables are there. What's the difference from looking at them on a PDF or on the record? 


Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark