- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-04-2022 06:39 AM
Hello,
Instead of writing insert code to insert the data source , you create a data source of your own manually and how glide the the same data source every time using glide record and pick up the latest record attached to it and get the sys id of the attachment and parse it and load it using the same piece of code which you mentioned above
OR
After the transform map runs , glide record the data source and remove all the attachments attached to it through script by gliding attachment table and then next time when you submit the record producer again attach the new one to the data source and then glide record to the data source and take that attachment and parse it and load it and then again delete it after the load .So doing this in loop through script will satisfy your second requirement and for info messages you can glide record the staging table logs in the record producer script and get the count of records which are having state as inserted and display the count in info message after the load happens
OR
if things are getting complicated use one API called glide Excel parser which is the best and easy API to integrate with Excel which would parse the data in the excel and insert it in staging table and then load it into the target table. You can do this in your record producer script only.
please refer to below link to see a sample code.
https://developer.servicenow.com/dev.do#!/reference/api/quebec/server/GEPS-getRow
Please mark this helpful if this answers your question!
Thanks