Create/Update/Delete records from an excel attached in RITM

Viraj Sapte
Tera Expert

Hi all,

I have a catalog item where we can attach an excel file. If we select create then the records should get created on a staging table. If we select update then the records on the staging table should be updated. If we select delete then the records from the staging table should be deleted. Please let me know how this can be achieved.

1 ACCEPTED SOLUTION

janani sundaram
Mega Expert

Hi Viraj,

 

You can create a run script to validate the data in excel by using GlideExcelParser API. Once the data are valid through data source and transform maps you can create/update/deactivate record in the required table.

Please refer the below article for detailed explanation,

https://www.servicenow.com/community/developer-articles/you-dont-know-sn-apis-glideexcelparser/ta-p/...

View solution in original post

3 REPLIES 3

Ankur Bawiskar
Tera Patron
Tera Patron

@Viraj Sapte 

I could understand the purpose.

But if you have transform map and data source insert/update on target will happen based on coalesce field.

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

Viraj Sapte
Tera Expert

@Ankur Bawiskar 
Thank you for you response. Currently nothing is developed. Can you please guide me on the same. Also, I need to validate the data before inserting, eg. the date filled in the excel file shouldn't be past date, means if it isn't a past date then only records must be inserted/updated.

janani sundaram
Mega Expert

Hi Viraj,

 

You can create a run script to validate the data in excel by using GlideExcelParser API. Once the data are valid through data source and transform maps you can create/update/deactivate record in the required table.

Please refer the below article for detailed explanation,

https://www.servicenow.com/community/developer-articles/you-dont-know-sn-apis-glideexcelparser/ta-p/...