Custom portal attachment variables issue

Rajkumar Bommal
Tera Contributor

Hi This is Rajkumar

am trying to build an application for that i have create a custom portal that user can access and raise a request from the record producer, when adding an attachment in attachment field its not getting saved into that variable and displaying empty.
Please go through the images

RajkumarBommal_0-1756892858789.png

 

 

RajkumarBommal_1-1756892858773.png

 

 

 

RajkumarBommal_2-1756892858806.png

 

 

1 ACCEPTED SOLUTION

@Rajkumar Bommal 

since it's for external user, I believe it's access issue.

try creating Table.None CREATE ACL on sys_attachment and add snc_external role to it and test

If my response helped please mark it correct and close the thread so that it benefits future readers.

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

View solution in original post

9 REPLIES 9

@Ankur Bawiskar 
No am not using catalog item page directly, 
its scoped application with snc_external role, for login page am using external user registration process for user to register in to the portal
And am using custom widgets, which directs to a catalog type TOPIC that i have created 

@Rajkumar Bommal 

since it's for external user, I believe it's access issue.

try creating Table.None CREATE ACL on sys_attachment and add snc_external role to it and test

If my response helped please mark it correct and close the thread so that it benefits future readers.

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

Thanks for the input, I have create a ACL with snc_external role and still it is not working on the portal 

RajkumarBommal_0-1756905757400.png

its working on PDI 

RajkumarBommal_1-1756905904177.png

 

 

@Ankur Bawiskar 
Thanks for the input, I have create a ACL with snc_external role and still it is not working on the portal 

RajkumarBommal_2-1756905944204.png

 

its working on PDI 

RajkumarBommal_3-1756905944217.png

 

 

kaushal_snow
Mega Sage

Hi @Rajkumar Bommal ,

 

I have implemented this in the past:

 

1. Map Variable to a File Attachment Field

Create a file attachment field (type Attachment) on your target table.

Map your record producer’s attachment variable to this field via the variable setup.

 

2. Use a Record Producer Script to Handle Attachments Manually

 

If mapping alone isn’t sufficient (e.g custom logic or routing is required), you can add a script in the Record Producer Script section to move the attachments...

var gr = new GlideRecord('sys_attachment');
if (gr.get(producer.attachment_variable_name)) {
gr.table_name = current.getTableName(); //
gr.table_sys_id = current.sys_id;
gr.update(); // Update the attachment to associate with the new record
}

Important note: Use gr.update() to reassign the existing attachment rather than gr.insert(), which creates a duplicate....

 

If you found my response helpful, please mark it as ‘Accept as Solution’ and ‘Helpful’. This helps other community members find the right answer more easily and supports the community.

 

Thanks and Regards,
Kaushal Kumar Jha - ServiceNow Consultant - Lets connect on Linkedin: https://www.linkedin.com/in/kaushalkrjha/