Unable to see record data in pdf when pdf generated via sn_ws.RESTMessageV2 API

Stephie Soo
Mega Guru

Hi all,

I'm trying to auto-generate PDF of my table record so i created a business rule to have it triggered upon certain changes in the record. 

I followed this article Generate PDF and attach to the record - ServiceNow Community and was able to generate the PDF successfully, however i'm not sure why the PDF generated is not showing my record data BUT if i access the setEndpoint url in the browser (with the user i used for authentication), the pdf generated is able to show the record data (i also confirmed via Access Analyze that the user can see all data).

Is there some configuration that i'm missing? 

Also note,
- the sys_user i'm using has admin role + web_service_admin role and
- my tables have "Allow access to this table via web services" enabled



1 ACCEPTED SOLUTION

Stephie Soo
Mega Guru

Hi all,

I've found out the root cause and it was a careless mistake on my end. The "pdfSysID" variable was filled in with the wrong sys_id (it was the sys_id of the table instead of the record), i've replaced it with current.sys_id and it works now.


View solution in original post

5 REPLIES 5

Stephie Soo
Mega Guru

Hi all,

I've found out the root cause and it was a careless mistake on my end. The "pdfSysID" variable was filled in with the wrong sys_id (it was the sys_id of the table instead of the record), i've replaced it with current.sys_id and it works now.