Exporting records to external XML file

Exporting records to external XML file

  
Hi all

What is the easiest way to export records to an external XML file in a specific format?
Is it by using XMLRecords?

I am a beginner using OutSystems so I find it really hard to use XMLRecords to achieve my goals. Does anyone have some pointers or tips as to where I could find more explanation or examples on how to use it?

Thanks!
Hello Claus,

I think you're better off going to an extension and build some C# code to transform RecordLists and other to your won XML.

Cheers
Pedro

Hello Claus,

I have not really tried to use XML Records myself yet, but there is an action "RecordListToXml" that can take by default only the RecordList you want to export. I believe this way it will export to a format where the names of the elements and attributes are equal to the names of the entities and attributes in Service Studio.

This is the way I would do it: use XML Records' "RecordListToXml" action to export each of your entities to the default format (or just one RecordList that you get from a query that includes all your entities). Then use XSL Transformation to transform the result XML to your required format (you can use the "Xsl_Transform" action from the "Xml" extension - assuming you are using version 8 of the Outsystems platform).

It is my experience that working with XML's with code is really time consuming and not flexible at all. Worse would be to work with Outsystems structures (sorry guys ;-)). XSL is really a powerful language meant exactly to create XML's (and other text files) in the exact format needed, given an input XML. And this input XML you can get from the action RecordListToXml.

If you are new to XSL, here are some pointers:

XSL - http://www.w3schools.com/xsl/default.asp
XPath - http://www.w3schools.com/xpath/default.asp

Check the Examples sections.

Best regards,
Pedro Vieira

Thanks Pedro - we will try that.
(Does anyone know if the XML format can be modified to be different from the names of records, etc. in XMLRecords?)

I think it can, that's the purpose of the additional configuration structures in the RecordListToXml action. But if you use XSL you won't need that.
 CREDITAPI1.oml
Hi,
Good Morning
Can anyone explain me how to map xpath values to record and then to 
OS database.
Please find my OML file for your reference.
Regards,
ChandrasekarRadhakrishnan
 
Hi,
I mean i want to save xpath values to be save in the OS database.
Regards,
ChandrasekarRadhakrishnan