Exporting EXCEL, CSV file in PORTAL

jabaya
Mega Guru

jabaya_0-1728274718050.png

 

Good afternoon! Is anyone aware of where to locate the configuration for exporting cases in list view on the portal? It seems that customer managers at a certain company can successfully export to PDF, but they are encountering a "User Not Authorized" error when trying to export to Excel or CSV. we have already checked roles, Script Includes, and ACLs. Any guidance would be greatly appreciated. Thank you!

9 REPLIES 9

Hello @jabaya 

You can check the client controller script. This contains the export Types. Refer the screenshot below

JuhiPoddar_0-1732174169031.png

So in the HTML 

JuhiPoddar_2-1732174254513.png

If you see in HTML the href is 

/{{data.table}}_list.do?{{::t.value}}&sysparm_query={{data.exportQueryEncoded}}&sysparm_view={{data.view}}&sysparm_fields={{data.fields}}

Adding the demo data to this href will convert it to a file link.

{"data":
	{
		"table": "incident",
		"view": "default",
		"o": "opened_at",
		"d": "desc",
		"filter": "activeEQtrue",
		"p": 1,
		"fields": "number,short_description"
	}
}
/incident_list.do?EXCEL&sysparm_query=activeEQtrue&sysparm_view=default&sysparm_fields=number,short_description

Test this in your instance where the URL will be something like this:

https://dev123456.service-now.com/incident_list.do?EXCEL&sysparm_query=activeEQtrue&sysparm_view=default&sysparm_fields=number,short_description

This is for Excel file, similarly you can add 'PDF' and 'CSV'. Just replace the EXCEL in url with the desired format.

 

Hope this helps!

"If you found my answer helpful, please like and mark it as the "accepted solution". It helps others find the solution more easily and supports the community!"

 

Thank You
Juhi Poddar

Hi Juhi,

For me Export option is working the only issue the export file shows field exported are ( 

NumberTask typeShort descriptionStatePriority

)

I need to also export created and updated fields in this export option. but don't know where i need to update ( server script or Client script or both )so get this working.

Regards,
b

Hello @Bijender 

Since a specific view is being used, only the columns included in that view will be exported. To ensure the necessary data is included, please add the required columns to the specified view. Only columns present in the selected view will be part of the export.

Hope this helps!

 

"If you found my answer helpful, please like and mark it as an "accepted solution". It helps future readers to locate the solution easily and supports the community!"

 

Thank You
Juhi Poddar

Hi Juhi,
View is showing created and updated , its just when export the file, does not contain these field.

Bijender_0-1748962148619.png

 

Regards,
b

Hello @Bijender 

Add the sys_created_on and sys_updated_on fields to the demo data. This will ensure these fields are included in the export URL.

The URL should look like this with the created and updated fields added:

https://dev123456.service-now.com/incident_list.do?EXCEL&sysparm_query=activeEQtrue&sysparm_view=default&sysparm_fields=number,short_description,sys_created_on,sys_updated_on

Hope this helps!

 

"If you found my answer helpful, please like and mark it as an "accepted solution". It helps future readers to locate the solution easily and supports the community!"

 

Thank You
Juhi Poddar