I want to create a road map on how to automatically import lead and client data into SuiteCRM and this will be the working article I use to record my progress, and reference later.
Currently, the plan is to create a sub domain that all lead data will first go to for scrubing and massaging, and from there it will go on to the SuiteCRM system for import.
In the sub domain, the mapping of fields will occur, along with changing caps of any given data point, and phone numbers formated correctly etc….
Because PHP has a built-in parser called SimpleXML Parser (fair enough name for an XML parser I believe), I will attempt to use that and see how it goes.
In order to read an XML string of data, the PHP simpleXML_load_string() function is used.
Using sample test data, we can see this in action:
"<?xml version='1.0' encoding='UTF-8'?>
The above XML is read using the following code:
$xml=simplexml_load_string($ClientXMLData) or die("Error: Cannot create object");
The print_r should give us something that looks like:
SimpleXMLElement Object ( [FirstName] => Lori[LastName] => Robert[heading] => New Client [CompanyName] => ABC Company )
The XML documents I want to import includes the following fields
<InsuranceRequest xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<Address>79108 Mopac Hwy</Address>
Robert Weinstein is a husband, dad, stock market junkie, real estate broker, and of course…Insurance agent. Interests include my family, economics, marketing, technology, real estate, finance/investing, history, and Asia.
Robert’s insurance expertise includes having the designation of Certified in Long-Term Care (CLTC) and assist in asset protection for families with members entering retirement.
Robert is also an accomplished syndicated writer whose work can be found in TheStreet, MainStreet, CNBC, Forbes, Yahoo Finance, Seeking Alpha, MSN Money, The Money Show, Stock Saints, Motley Fool, Fidelity, Minyanville, RealMoney Pro, and many national and international newspapers.