Data load and transform using catalog item

SK41
Giga Guru

Hi All,

 

I have a requirement where I have to load the data in a table in scoped app, using attachment which user will attach on a catalog item. When user submits the request, it should invoke the transform map and automatically load the data in the table. I am able to achieve this taking reference from below article, but I am facing few issues.

 

Data load and transform via Catalog Item - Page 5 - ServiceNow Community

by @Ankur Bawiskar 

 The delete attachment through scheduled import is not working, although I followed the same steps. Not sure what could be the reason.

 

Also, when the data load happens, it is creating all the records in required table but it also creates an empty record as well whenever the transformation happens. Can anyone help?

 

I followed the same steps in the above link (shared), @Ankur Bawiskar  Could you please suggest what can be the issue?

 

1 ACCEPTED SOLUTION

API also not solved the issue.

 

I found the solution for it. I created Script include in global and made it accessable for all scopes and put the delete attachment code in it. I Called this script include in my scheduled import's post import script. Also, keeping the cross scope privelege where "delete" is "allowed" for customer service application.

 

This solution worked for me! 

 

Thanks, for all the help!Appreciate it!

View solution in original post

19 REPLIES 19

Kristen Ankeny
Kilo Sage

For the delete question: did you replace the <dataSourceSysId> with the sys_id of the data source?

For the data load empty record - if you're using excel, I would check to see if it is importing the header row as well. 

Hi, 

yes ,I am passing the data source sysid.

How can I ensure that empty record is not created?

If the sheet is in excel, check your settings on the data source for the header row. 

Ankur Bawiskar
Tera Patron
Tera Patron

@SK41 

OOB Can Delete checkbox on sys_attachment table is unchecked

AnkurBawiskar_0-1704460807762.png

 

so you need to enable the cross scope for deleting the attachment record

Create this record for your scoped app. Ensure you are in your scoped app and create this new record from cross scope module

AnkurBawiskar_1-1704461060018.png

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