UI action to export specific section of Form to PDF

Omkar Kumbhar
Mega Sage
Mega Sage

Hello Community,

 

Is there any way to extract the Fields from the particular section of the form to PDF.

As anyone achieved this requirement. BY creating a new View and adding the fields and export to pdf is one solution. bu tplease let me know if there is any other solution apart from creating a view. 

Thank you in advance.

 

Thanks,

Omkar

 

 

If I was able to help you with your case, please click the Thumb Icon and mark as Correct.
4 REPLIES 4

Samaksh Wani
Giga Sage
Giga Sage

Hello @Omkar Kumbhar 

 

function export2PDF() { 
 var sysparm_sec = g_form.getSections('name of your section'); 
 var sysparm_sys_id = g_form.getUniqueValue().toString(); 
 var instanceName = 'https://my-instance.service-now.com/';
 var url = instanceName+sysparm_sec + '.do?PDF&sys_id=' + sysparm_sys_id; 
 g_navigation.openPopup(url);
}

 

 

Plz mark my solution as Accept, If you find it helpful.

 

Regards,

Samaksh

Hello @Samaksh Wani ,

Thank you for your response! Unfortunately it is not Working. How you will add the sysparm section in URL. I searched in the Docs but i did not find anything related to sections we can sysparm it in URL. If you have any docs links please share.

 

Thank you,

Omkar

If I was able to help you with your case, please click the Thumb Icon and mark as Correct.

Hello @Omkar Kumbhar 

 

You can create a view of your section, which you can open it into the pop up.

 

Plz mark my solution as Accept, If you find it helpful.

 

Regards,

Samaksh

Samaksh Wani
Giga Sage
Giga Sage

Hello @Omkar Kumbhar 

 

If you want to know the name of your sections 

 

.getSectionNames() is used.

 

Plz mark my solution as Accept, If you find it helpful.

 

Regards,

Samaksh