Exporting EXCEL, CSV file in PORTAL
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-06-2024 09:22 PM
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!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-17-2024 10:26 PM
up

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-17-2024 10:43 PM
In ServiceNow, exporting cases (or any records) from a list view on the portal to formats like PDF, Excel, or CSV is typically governed by a combination of roles, permissions, and specific export configurations in the system. Since you've already checked roles, Script Includes, and ACLs, here are some other potential areas to investigate to resolve the "User Not Authorized" error for exporting to Excel or CSV:
1. List Layout Configuration
Ensure that the list view you're working with (e.g., for Cases or Incident records) has the correct export permissions configured:
Navigate to the List Layout for the specific table you're working with (e.g., Incident, Case).
Go to System Definition > Tables.
Locate the table (e.g., Incident or Case).
Review the List Layout and ensure that the users can see the appropriate columns and data in the list.
Check if there are any field-level ACLs that could be blocking export, particularly for Excel/CSV. Even though you mentioned you checked ACLs, double-check if there are specific rules for list export actions on certain fields or columns.
2. Export Configuration in List Context Menu
Sometimes, the export functionality is controlled via settings in the list context menu:
Make sure the Export to Excel and Export to CSV options are enabled for the list. Navigate to the list view where users are having issues.
Check if the Export options are restricted based on the conditions in UI Actions or UI Policies.
3. UI Actions for Export
UI Actions are often responsible for how the system handles exporting to different formats. You can check if any UI Actions are conditionally blocking the export for certain users.
Go to System UI > UI Actions.
Look for any UI Actions that correspond to Export to Excel or Export to CSV.
Review any Conditions or Scripts that may restrict this action based on roles or user context.
4. Export Permissions
ServiceNow has specific permissions that may need to be set to allow exporting to different formats:
Review the role or access settings for users who are encountering the "User Not Authorized" error. For example, the export permissions are sometimes associated with roles like admin, itil, or custom roles that explicitly allow export functionality.
Check if any specific Permissions for Data Export are configured for the list. Sometimes, administrators restrict export permissions to specific user groups for security or compliance reasons.
To check export-specific roles:
Go to System Security > Access Control (ACL).
Search for ACL rules related to export functionality, particularly for the table and specific actions (e.g., list export). Ensure that the users have the necessary permissions to perform export actions.
5. Export Restrictions via Script Includes or Business Rules
If you have custom Script Includes or Business Rules governing data access or export, check them to ensure that there isn't a script explicitly denying export to CSV/Excel for the users in question.
Review any Data Policies or Business Rules that may restrict or modify the data being exported to certain file types, and ensure that no restrictions are applied to Excel or CSV exports.
6. Client Scripts and UI Policies
If the export error appears after a certain action is taken (for example, after trying to export a specific list), check the Client Scripts and UI Policies that might be affecting the behavior of the export function:
Look for Client Scripts or UI Policies that could be restricting the "Export to Excel" or "Export to CSV" options.
For example, if there's a UI Policy that hides or disables the export buttons based on conditions like user role or list data, this could be triggering the error.
7. Check System Logs
Review the System Logs or System Logs > Errors for any specific errors or warnings that might give you more details about why the export functionality is failing:
Look for any error messages related to permissions or export failures when a user tries to export to CSV or Excel.
This can give you a more detailed clue as to which specific action or permission is being blocked.
8. Instance Version & Plugins
Some export-related features or restrictions could also be affected by the version of your ServiceNow instance or any active plugins:
Verify that your instance is up to date with the required patches or features for exporting to Excel/CSV.
Check if any specific plugins related to reporting or export functionality are not installed or have been disabled.
9. Test with Different User Roles
To further isolate the issue, you could test the export functionality with different user roles. Try logging in as an admin or a user with elevated permissions to see if the issue persists. This can help confirm whether the problem is related to specific user permissions or roles.
10. Contact ServiceNow Support
If you've gone through all the troubleshooting steps and the issue persists, it might be helpful to reach out to ServiceNow support. They can assist in diagnosing potential system or configuration-specific issues that may not be immediately apparent.
Summary Checklist:
Confirm that Export to Excel and Export to CSV are enabled in the list context menu.
Verify that there are no UI Actions or UI Policies blocking the export functionality.
Double-check that the users have the necessary roles and permissions for exporting data.
Investigate any custom Script Includes, Business Rules, or ACLs that may be affecting the export.
Check System Logs for any specific error messages related to exporting.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-17-2024 11:17 PM
Hello @jabaya
This table is the "Data Table" widget. After examining the Data Table widget, I found that the export functionality is handled through HTML code in the widget, which dynamically builds the export URLs based on several parameters. Here's a relevant portion of the HTML code:
The export URLs are constructed using:
- data.table: The table name (e.g., incident).
- data.fields: The fields to include in the export (e.g., number, short_description).
- data.exportQueryEncoded: The encoded query string for filtering the records.
- data.view: The view to use (e.g., default).
Here's an example JSON structure passed to the widget:
Each parameter corresponds to the table, view, sorting, filters, and fields for export.
Observations and Next Steps
ACLs and Permissions:
- Check if there are specific ACLs on the incident table or the fields (number, short_description) that restrict exporting to Excel/CSV for the user roles (e.g., snc_external, snc_internal).
Script Analysis:
- Review the Client Controller, Server Script, and HTML template of the Data Table widget to understand how the export functionality is implemented and whether the issue stems from URL generation or role restrictions.
Widget Debugging:
- The export types (e.g., PDF, Excel, CSV) are dynamically defined and iterated with exportTypes. Ensure this is configured properly.
URL Debugging:
- Check if the generated URL for Excel/CSV exports aligns with the correct structure and permissions.
"If you found my answer helpful, please give it a like and mark it as the "accepted solution". It helps others find the solution more easily and supports the community!"
Thank You
Juhi Poddar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-20-2024 11:07 PM
Hi @Juhi Poddar
as for this part "exportTypes. Ensure this is configured properly." care to elaborate how can i ensure this is configure correctly ?