Important Update: Archer Community Scheduled Maintenance on November 23–24 - New Community Launching Soon! Learn More..
2018-09-27 10:17 AM
I am trying to send a file to a location for another system to process. I created a report with 20 fields that is exactly what they need. If I export it to XML online it is in a format that is very useful. Such as this:
<?xml version="1.0" encoding="utf-8"?><ex:Record xmlns:ex="http://archertech.com/Print/Export"><ex:Item><ex:GEAR_ID>1</ex:GEAR_ID><ex:Office><ex:Item>GSA IT Acquisition (IQ)</ex:Item></ex:Office><ex:System_Name>Acquisition Planning Module (APM)</ex:System_Name><ex:Operated_By><ex:Item>Federal</ex:Item></ex:Operated_By><ex:FIPS_Impact_Level><ex:Item>Moderate</ex:Item></ex:FIPS_Impact_Level>
However if I use the $ws.SearchRecordsByReport command in an Powershell API script to save this report like this:
Do {
"Page " + $page
[xml] $xdoc = $ws.SearchRecordsByReport($session_token, $report_id, $page)
$xdoc.InnerXml | Out-File -filepath $FileForGEAR -Append -encoding ascii -Width 120
$page++
} While ($xdoc.Records.Record.Count -gt 0)
I get something else like this:
<?xml version="1.0" encoding="utf-16"?><Records count="209"><Metadata><FieldDefinitions><FieldDefinition id="21415" guid="99fb121f-00ce-4838-99e0-0f6348885f84" name="System Name" alias="System_Name" /><FieldDefinition id="21416" guid="8709ab9e-228e-4ed3-a372-4e8be3b6477e" name="Office" alias="Office" /><FieldDefinition id="21418" guid="38c23e3b-d6ad-4130-89e3-9ec77690a765" name="Operated By" alias="Operated_By" /><FieldDefinition id="21419" guid="e8c88dc1-c4e2-4c8d-87b7-0411ceb759fc" name="FIPS Impact Level" alias="FIPS_Impact_Level" /> .........
Removed 24 lines for simplicity
.......1</Field><Field id="21416" guid="8709ab9e-228e-4ed3-a372-4e8be3b6477e" type="9"><Reference id="224938">GSA IT Acquisition (IQ)</Reference></Field><Field id="21415" guid="99fb121f-00ce-4838-99e0-0f6348885f84" type="1">Acquisition Planning Module (APM)</Field><Field id="21418" guid="38c23e3b-d6ad-4130-89e3-9ec77690a765" type="4"><ListValues><ListValue id="74128" displayName="Federal">Federal</ListValue></ListValues></Field>
My questions are:
2018-09-27 11:43 AM
When you export to XML from the Archer interface you do not get the field metadata that you do when you use the webservices.
I personally have been using .net to create our exports. I am, however, creating it in the form of a .csv. But, I'm sure you could leave it as XML and parse out the header metadata.
Regarding your third question... I'm not suggesting if, but if this is your requirement, you could email the report to a group mailbox and use another application to pull it and post the file.
However, if you have to build that application, it would seem like equal development effort to just creating an application pulls the report and export to an XML file.
2018-09-27 12:47 PM
I keep thinking datafeed -- Transport only to xml...
2018-09-27 02:48 PM
Jason, thanks for the reply. I will give that a try.