7 Replies Latest reply on Jan 15, 2016 5:24 AM by jurgmay

    How best to populate records from XML?


      Hi all,


      I'm working on a solution which pulls eCommerce orders from our online platform and populates that information into our local FM database.


      At the moment I retrieve a cXML file and enter that into a field (titled 'xml') which in turn triggers field level Auto Enter calculations which parse the XML and populate the fields with the corresponding XML data (i.e. the 'orderQuantity' field Auto Enter calc parses the XML and pulls out the Quantity value from the XML). This all works perfectly but it just 'feels' like the wrong approach. For example, if I delete the XML in the 'xml' field then all of the fields which are dependent on that data become blank (quite rightly as there is no XML to parse).


      I wonder if there's a 'best practice' approach to this. Should I script it? Or maybe I should change the Auto Enter calcs so that deleting the original XML can be done without affecting the content of the dependent fields?


      Incidentally, I mention deleting the original XML as, again, it seems 'wrong' to store the original XML in addition to the parsed data which is then populated into the fields ('orderQuantity' etc). I'm effectively storing the same data twice but in different ways and I'm just not loving the dependencies.


      I'd appreciate any thoughts on this.


      Thanks as always.