Hi all,
How to read the xml data and write it into Rollbase Object.
Thanks,
Sudhakar
Hello,
Can you please clarify your requirement?
Thanks.
i need to store data into Rollbase object from an XML file while we are uploading the xml file..
Hello,
Please consider using "File Upload" field in Rollbase object.
Hope this helps.
Thanks.
Hi Sidury,
my requirement is not only storing the xml file, i want to store the values from the XML file.
ex: consider some part of xml file is
<book id="bk105">
<author>Corets, Eva</author>
<title>The Sundered Grail</title>
<genre>Fantasy</genre>
<price>5.95</price>
<publish_date>2001-09-10</publish_date>
<description>The two daughters of Maeve, half-sisters,
battle one another for control of England. Sequel to
Oberon's Legacy.</description>
</book>
i want to store the author,title,genre,price... as fields and Corets,Eva The Sundered grail,Fantasy,5.95.. as the field values in Rollbase object
Hi,
An idea could be when you create a new record uploading the xml file, you could create an Object Script trigger with following code:
/**
In this example my RB object name is:test and xml_file the upload file
*/
var xml = rbv_api.getTextData("test", {!id}, "xml_file"); /* Move the content from xml file uploaded in a string var*/
var root = rbv_api.parseXML(xml);
author = root.getElementsByTagName('author').item(0).getFirstChild().getNodeValue(); /* Get the xml value of author */
title = root.getElementsByTagName('title').item(0).getFirstChild().getNodeValue();/* Get the xml value of title*/
/*** You should repeat in the same way for the rest of your field in the xml file ***/
rbv_api.setFieldValue("test",{!id},'author',author); /** You can use this method to save the value in your RB fields**/
rbv_api.setFieldValue("test",{!id},'title',title);
Hope this help,
Miguel
thank you [mention:560ea9bef1ac488b986d6da8f043b779:e9ed411860ed4f2ba0265705b8793d05] ,
Perfectly working.