Is it possible to export the table records daily through schedule job?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-03-2022 01:26 AM
I need to run a job daily, which needs to export the data(in incident table) as an XML and needs to trigger an email to x,y persons with that attachment..
is it possible>?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-03-2022 01:50 AM
Hi,
you need to use custom solution for this
1) schedule job daily at particular time
2) create the xml file using script by forming the xml tags via script and attach it to some record without which you cannot include that in email
3) if report is for incident then attach it to some incident and include the recipients etc using eventQueue() function
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-03-2022 02:58 AM
Can you please explain me bit more clearly..
Daily I need to export all incidents into an XML and need to mail for x, y persons.. this is my requirement.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-03-2022 03:39 AM
not an easy one to accomplish.
I already mentioned the approach above.
But the code would be tedious and difficult to maintain.
If they want XML then you can use export set capability with XML type.
When export set generates the file to be pushed to mid server, it adds an entry into table "ecc_agent_attachment"
You can create notification on this table and use the Include Attachment checkbox
Add the users email in notification as recipient.
I hope you got the approach and can take it forward from here.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-03-2022 08:01 AM
In "ECC_Agent_attachment" there is no unique field to find out from which export set we are getting the file...
So I tried of using "sys_attachment" table... mail is triggering as expected.. but attachment is not getting added to the mail.. how can I do that? please help @Ankur Bawiskar