Copy attachment from record producer variable to record is not working

Renu9
Tera Contributor

I am trying to copy an attachment from variable in record producer to record with the below BR, but its not working

I am using Async insert BR on the table (x_as_request) in scoped app.

In line number 5, im getting 'x_as_request' table in the log.

 

Renu9_0-1713280017902.png

 

In the attachment table, I am seeing the table name as ZZ_YYsc_cart_item and the table sys id is empty. 

I assume table sys id should not be empty . Please help me here attachment is not getting added to record.

Renu9_1-1713280071898.png

 

10 REPLIES 10

@Ankur Bawiskar 

I commented out line number 6, still its not going to if.

Why table_sys_id is coming as empty in attachment table. Is it because I was using an attachment type variable?

@Renu9 

table_sys_id should be present in sys_attachment. that's the issue.

Did you verify with some other catalog item/record producer with attachment variable?

if the issue is coming for that as well, seems some platform issue

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

Hi @Ankur Bawiskar 

For other record producers also, the table sys id is coming as empty.

 

If that is the case, then I tried with a different approach also , I am taking a custom drag and drop attachment as below.

I have written a on submit catalog client script but it is not working, here the attachment is getting 

Renu9_1-1713327137102.png

 

Renu9_0-1713327119721.png

 

Below is the script,  but everytime the row count is getting as 0

Renu9_2-1713327202200.png

 

I assume in line number 31, I was comparing proof var(which is sys id of record producer), but in the attachment table, it is appearing like the file name that I was attaching. Please help here.

I even raised an another post, I will tag you there, can you please guide, so I can achieve my requirement in the other way atleast

https://www.servicenow.com/community/itsm-forum/onsubmit-client-script-is-not-working-for-attachment...

 

@Renu9 

your earlier approach should work.

Did you try for record producer in global scope or custom scope?

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

@Ankur Bawiskar  Record producer is in custom scoped application 

you meant to say, catalog client script right? Custom drag and drop?