Problem in extracting the XML extract

Discussion on developing CloverETL engine, transformation components etc.

girish_526
Posts: 16
Joined: Wed Jan 04, 2017 7:14 am

Problem in extracting the XML extract

Postby girish_526 » Wed Nov 22, 2017 9:41 am

Hi Everyone,

I need to extract the below XML. But I am unable to extract all the fields. Please help.

I need to extract the Bold Tags.

Appreciate your help.

Thanks,
Girish.

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns="urn:enterprise.soap.sforce.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:sf="urn:sobject.enterprise.soap.sforce.com">
<soapenv:Header>
<LimitInfoHeader>
<limitInfo>
<current>79</current>
<limit>15000</limit>
<type>API REQUESTS</type>
</limitInfo>
</LimitInfoHeader>
</soapenv:Header>
<soapenv:Body>
<queryResponse>
<result>
<done>true</done>
<queryLocator xsi:nil="true"/>
<records xsi:type="sf:OpportunityLineItem">
<sf:Id>00kC000000iYkMOIA0</sf:Id>
<sf:Opportunity xsi:type="sf:Opportunity">
<sf:Id xsi:nil="true"/>
<sf:Account xsi:type="sf:Account">
<sf:Id xsi:nil="true"/>
<sf:Name>Business World</sf:Name>
</sf:Account>
<sf:AccountId>001C000001UBcYPIA1</sf:AccountId>
<sf:Amount>4000.0</sf:Amount>
<sf:Campaign_End_Date__c>2018-08-31</sf:Campaign_End_Date__c>
<sf:Campaign_Start_Date__c>2017-08-31</sf:Campaign_Start_Date__c>
<sf:CloseDate>2017-08-31</sf:CloseDate>
<sf:Name>GC_TEST11202017_1</sf:Name>
<sf:StageName>Qualification</sf:StageName>

</sf:Opportunity>
<sf:Product2 xsi:type="sf:Product2">
<sf:Id xsi:nil="true"/>
<sf:Name>Echeck</sf:Name>
</sf:Product2>
<sf:Quantity>120.0</sf:Quantity>
<sf:TotalPrice>3000.0</sf:TotalPrice>
<sf:UnitPrice>25.0</sf:UnitPrice>

</records>
</result>
</queryResponse>
</soapenv:Body>
</soapenv:Envelope>

bartonv
Posts: 56
Joined: Wed May 03, 2017 12:10 pm

Re: Problem in extracting the XML extract

Postby bartonv » Thu Nov 30, 2017 4:58 pm

Hello Girish,
from the snippet of your XML, I would suggest using the XMLExtract component to generate the XSD schema and take advantage of its visual mapping feature. Moreover, I would recommend using the ‘Populate parent record’ functionality as the fundamental concept of your data extraction as it helps flatten the output data structure, thus reducing the number of output ports. More information about this concept can be found in our documentation (namely in the ‘XMLExtract Mapping Editor and XSD Schema’ part).
Attached is an example solution based on the provided input data. I have demonstrated 2 approaches one of which extracts the data in a flat structure while the other one sends the data to 2 different ports. If you have any additional questions, feel free to get back to us.
Best regards,
Attachments
2017112310000136.zip
(8.88 KiB) Downloaded 31 times
---
Vladimir Barton
CloverCARE Support
CloverETL | Rapid Data Integration

Visit us online at http://www.cloveretl.com
How to speed up communication with CloverCARE support

girish_526
Posts: 16
Joined: Wed Jan 04, 2017 7:14 am

Re: Problem in extracting the XML extract

Postby girish_526 » Fri Dec 01, 2017 5:44 am

Thanks Vladimir Barton, this helped me alot.

the_goat
Posts: 19
Joined: Fri Dec 01, 2017 6:16 am

Re: Problem in extracting the XML extract

Postby the_goat » Fri Dec 01, 2017 6:37 am

@Girish: Seems like you're working with Salesforce SOAP API, is there any reason why you're not using WebServiceClient component (and WSDL for that matter) rather than XMLExtract?

Or you have a file downloaded and trying to process?