Showing "User Not Authorized" error while exporting to excel/csv from portal widget

Omkar Ranjane
Tera Guru

I have widget "Data Table from Instance Definition" on CSM portal.

I have added filter as "Sys_id is one of javascript:new global.caseManagmentUtils().getMyCase();" 

Script include is fetching sys_id of records.

Customer user have access to case table.

Refer below screenshot.

OmkarRanjane_0-1674479943256.png

Record are visible but, while exporting as excel/CSV, customer is getting below error

OmkarRanjane_1-1674480079278.png

OmkarRanjane_2-1674480124289.png

 

Export works when I add normal filter, but my requirement is not satisfying with normal filter, for that reason script include is created. How do I resolve this issue ?

Is there something that I missed ?

@Ankur Bawiskar 

@Gunjan Kiratkar

@Community Alums 

@RaghavSh 

@jaheerhattiwale 

 

Thanks in advance.

4 REPLIES 4

Ankur Bawiskar
Tera Patron
Tera Patron

@Omkar Ranjane 

Is it working fine with admin user?

any query BR is restricting the records?

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Hi @Ankur,

I'm also facing same issue in service portal, I'm able to export PDF and Excel but not for CSV. While selecting CSV I'm getting "

User Not Authorized"

  this message. I do have admin rights still. can you please guide me on this. PFA screen shot.

Ashish64_0-1724946873236.png

 

Craig Gruwell
Mega Sage

When you export with the normal filter, are you logged in as the same user?

 

Can you paste the URLs you are directed you when you export with the normal filter as well as the filter using the script include?

 

Sohithanjan G
Kilo Sage
Kilo Sage

Hi @Omkar Ranjane,

 

We usually face those issues when we are doing export for Excel & CSV types because of some roles & ACLs.

"User Not Authorized" error is only due to ACL & you need to work on ACLs on that table that you are exporting. So you can enable the Security Dubg > Enable All

And, give the necessary role to that particular ACL which is failing. It helped me this way too. 


Please mark my answer as Accepted Solution & helpful if this suffice this requirement.

BR, Sohith

Please mark as Accepted Solution if this solves your query and HIT Helpful if you find my answer helped you. This will help other community mates too..:)