Build xml file used as control file to be sent with csv exports of servicenow tables

adamtrent
Tera Contributor

Hi,

Requirements:

1. Create scheduled report of the incident table (for example)

2. An xml file must be sent with the scheduled report and contain the following data, some data set dynamically each time the report is generated (e.g. NumberOfRecords):

Control file xml:

<?xml version="1.0" encoding="utf-8" ?>

<Feed>

      <Name>(e.g. Name of report/table export</Name>

      <ExtractType>(e.g. Source system 'ServiceNow')</ExtractType>

      <GenerationDate>(e.g.2011-01-18 17:59:41)</GenerationDate>

      <NumberOfRecords>10</NumberOfRecords>

      <Contact Name=(e.g."ServiceNowTeam" EmailAddress="servicenowadmins@XYZ.com" />

      <FieldDelimiter>(e.g. ',')</FieldDelimiter>

       <DataDate>2011-01-16</DataDate>

</Feed>

 

3. Create the above xml and attach to a scheduled report record (or similar) so it is sent as an additional attachment with the scheduled report. Could also be a scheduled export, it doesn't have to be a report.

 

Is there a way to generate this xml file using a script in ServiceNow to run on a schedule and update the xml values with the latest information from the accompanying report? And then save the xml as an attachment perhaps to a data source to similar, for retrieval when the export is sent?

 

Thanks

 

The reason for the xml file is that an export of e.g. the incident table, will be sent out to be consumed by a third party database and the control file is used to validate the inputs.

 

 

 

0 REPLIES 0