Hi Team,
Please help me in extracting the XML fields from the below payload.
<Mappings>
<Mapping element="{urn:enterprise.soap.sforce.com}queryResponse">
<Mapping element="{urn:enterprise.soap.sforce.com}result">
<Mapping element="{urn:enterprise.soap.sforce.com}records" outPort="0"
xmlFields="{urn:sobject.enterprise.soap.sforce.com}Id;{urn:sobject.enterprise.soap.sforce.com}Quantity"
cloverFields="Record_Id;Quantity">
<Mapping element="{urn:sobject.enterprise.soap.sforce.com}Opportunity" useParentRecord="true"
xmlFields="{urn:sobject.enterprise.soap.sforce.com}Campaign_End_Date__c;{urn:sobject.enterprise.soap.sforce.com}Campaign_Start_Date__c;{urn:sobject.enterprise.soap.sforce.com}CloseDate;{urn:sobject.enterprise.soap.sforce.com}Name;{urn:sobject.enterprise.soap.sforce.com}StageName"
cloverFields="End_Date;Start_Date;Close_Date;Opportunity_Name;StageName">
<Mapping element="{urn:sobject.enterprise.soap.sforce.com}Account" useParentRecord="true"
xmlFields="../{urn:sobject.enterprise.soap.sforce.com}Name;{urn:sobject.enterprise.soap.sforce.com}Name"
cloverFields="Opportunity_Name;Account_Name">
</Mapping>
</Mapping>
<Mapping element="{urn:sobject.enterprise.soap.sforce.com}Product2" useParentRecord="true"
xmlFields="{urn:sobject.enterprise.soap.sforce.com}Name"
cloverFields="Product_Name">
</Mapping>
</Mapping>
</Mapping>
</Mapping>
</Mappings>
Please help me in extracting the XML fields from the below payload.
<Mappings>
<Mapping element="{urn:enterprise.soap.sforce.com}queryResponse">
<Mapping element="{urn:enterprise.soap.sforce.com}result">
<Mapping element="{urn:enterprise.soap.sforce.com}records" outPort="0"
xmlFields="{urn:sobject.enterprise.soap.sforce.com}Id;{urn:sobject.enterprise.soap.sforce.com}Quantity"
cloverFields="Record_Id;Quantity">
<Mapping element="{urn:sobject.enterprise.soap.sforce.com}Opportunity" useParentRecord="true"
xmlFields="{urn:sobject.enterprise.soap.sforce.com}Campaign_End_Date__c;{urn:sobject.enterprise.soap.sforce.com}Campaign_Start_Date__c;{urn:sobject.enterprise.soap.sforce.com}CloseDate;{urn:sobject.enterprise.soap.sforce.com}Name;{urn:sobject.enterprise.soap.sforce.com}StageName"
cloverFields="End_Date;Start_Date;Close_Date;Opportunity_Name;StageName">
<Mapping element="{urn:sobject.enterprise.soap.sforce.com}Account" useParentRecord="true"
xmlFields="../{urn:sobject.enterprise.soap.sforce.com}Name;{urn:sobject.enterprise.soap.sforce.com}Name"
cloverFields="Opportunity_Name;Account_Name">
</Mapping>
</Mapping>
<Mapping element="{urn:sobject.enterprise.soap.sforce.com}Product2" useParentRecord="true"
xmlFields="{urn:sobject.enterprise.soap.sforce.com}Name"
cloverFields="Product_Name">
</Mapping>
</Mapping>
</Mapping>
</Mapping>
</Mappings>
-
Hello Girish,
Could you please elaborate more on what exactly you are trying to accomplish? Based on the payload sent you are using the XMLExtract to process information from a Salesforce SOAP API, and everything looks in order. Are you getting an error of sorts when extracting the data? Also is there a reason why you are not using the WebServiceClient component or do you have the file download beforehand? -
Hi Pedro Vazquez Rosario,
I had the XML file in hand. I want to extract the fields like firstname,lastname,email etc.
Thanks,
Girish. -
Like I mentioned prior you can use the XMLExtract to extract the fields you mentioned. You can follow the same steps as described in the following forum post:
https://forum.cloveretl.com/viewtopic.php?f=5&t=7541&p=13089#p13095 -
Hi,
I still unable to get all the fields. Please help.
<Mappings>
<Mapping element="{urn:com.workday/workersync}Worker_Sync">
<Mapping element="{urn:com.workday/workersync}Worker">
<Mapping element="{urn:com.workday/workersync}Personal" outPort="0">
<Mapping element="{urn:com.workday/workersync}Name_Data" useParentRecord="true"
xmlFields="{urn:com.workday/workersync}First_Name;{urn:com.workday/workersync}Last_Name"
cloverFields="First_Name;Last_Name">
</Mapping>
<Mapping element="{urn:com.workday/workersync}Email_Data" useParentRecord="true" implicit="false"
xmlFields="{urn:com.workday/workersync}Email_Address;{urn:com.workday/workersync}Email_Type;{urn:com.workday/workersync}Is_Primary"
cloverFields="Email_Address;Email_Type;Is_Primary">
</Mapping>
</Mapping>
<Mapping element="{urn:com.workday/workersync}Status" outPort="0"
xmlFields="{urn:com.workday/workersync}Hire_Date;{urn:com.workday/workersync}Original_Hire_Date;{urn:com.workday/workersync}Rehire;{urn:com.workday/workersync}Terminated"
cloverFields="Hire_Date;Original_Hire_Date;Rehire;Terminated">
</Mapping>
<Mapping element="{urn:com.workday/workersync}Position" outPort="0"
xmlFields="{urn:com.workday/workersync}Effective_Date;{urn:com.workday/workersync}Job_Profile;{urn:com.workday/workersync}Position_Time_Type;{urn:com.workday/workersync}Worker_Type"
cloverFields="Effective_Date;Job_Profile;Position_Time_Type;Worker_Type">
<Mapping element="{urn:com.workday/workersync}Organization_Data" useParentRecord="true"
xmlFields="../{urn:com.workday/workersync}Effective_Date;../{urn:com.workday/workersync}Job_Profile;../{urn:com.workday/workersync}Position_Time_Type;../{urn:com.workday/workersync}Worker_Type;{urn:com.workday/workersync}Organization;{urn:com.workday/workersync}Organization_Type"
cloverFields="Effective_Date;Job_Profile;Position_Time_Type;Worker_Type;Organization;Organization_Type">
</Mapping>
<Mapping element="{urn:com.workday/workersync}Supervisor" useParentRecord="true"
xmlFields="../{urn:com.workday/workersync}Effective_Date;../{urn:com.workday/workersync}Job_Profile;../{urn:com.workday/workersync}Position_Time_Type;../{urn:com.workday/workersync}Worker_Type;{urn:com.workday/workersync}Supervisor_ID;{urn:com.workday/workersync}Supervisor_Name"
cloverFields="Effective_Date;Job_Profile;Position_Time_Type;Worker_Type;Supervisor_ID;Supervisor_Name">
</Mapping>
</Mapping>
</Mapping>
</Mapping>
</Mappings> -
Hi,
It would be helpful if you could please post the structure of the XML you are trying to extract, without any sensitive data of course.
Thank You, -
Please find the XML
<ws:Worker_Sync xmlns:ws="urn:com.workday/workersync" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<ws:Header>
<ws:Version>25.0</ws:Version>
<ws:Prior_Entry_Time>2018-02-28T12:25:34.000-08:00</ws:Prior_Entry_Time>
<ws:Current_Entry_Time>2018-03-01T13:27:19.841-08:00</ws:Current_Entry_Time>
<ws:Prior_Effective_Time>2018-02-28T00:00:00.000-08:00</ws:Prior_Effective_Time>
<ws:Current_Effective_Time>2018-03-01T00:00:00.000-08:00</ws:Current_Effective_Time>
<ws:Full_File>false</ws:Full_File>
<ws:Document_Retention_Policy>30</ws:Document_Retention_Policy>
<ws:Worker_Count>1</ws:Worker_Count>
</ws:Header>
<ws:Worker>
<ws:Summary>
<ws:Employee_ID>800810</ws:Employee_ID>
<ws:Name>Garyy Song</ws:Name>
</ws:Summary>
<ws:Eligibility>true</ws:Eligibility>
<ws:Personal>
<ws:Name_Data>
<ws:First_Name ws:PriorValue="Gary">Garyy</ws:First_Name>
<ws:Last_Name>Song</ws:Last_Name>
</ws:Name_Data>
<ws:Email_Data>
<ws:Email_Type>WORK</ws:Email_Type>
<ws:Email_Is_Public>true</ws:Email_Is_Public>
<ws:Is_Primary>true</ws:Is_Primary>
<ws:Email_Address>gary.song@instacart.com</ws:Email_Address>
</ws:Email_Data>
</ws:Personal>
<ws:Status>
<ws:Active>true</ws:Active>
<ws:Hire_Date>2018-02-05</ws:Hire_Date>
<ws:Original_Hire_Date>2018-02-05</ws:Original_Hire_Date>
<ws:Terminated>false</ws:Terminated>
<ws:Rehire>false</ws:Rehire>
</ws:Status>
<ws:Position>
<ws:Operation>NONE</ws:Operation>
<ws:Effective_Date>2018-02-05</ws:Effective_Date>
<ws:Worker_Type>Regular</ws:Worker_Type>
<ws:Position_Time_Type>Full time</ws:Position_Time_Type>
<ws:Organization_Data>
<ws:Operation>NONE</ws:Operation>
<ws:Organization>INSTA-US-01</ws:Organization>
<ws:Organization_Type>Company</ws:Organization_Type>
</ws:Organization_Data>
<ws:Organization_Data>
<ws:Operation>NONE</ws:Operation>
<ws:Organization>6800</ws:Organization>
<ws:Organization_Type>Cost_Center</ws:Organization_Type>
</ws:Organization_Data>
<ws:Job_Profile>EN02E</ws:Job_Profile>
<ws:Management_Level>5</ws:Management_Level>
<ws:Supervisor>
<ws:Operation>NONE</ws:Operation>
<ws:Supervisor_ID>800009</ws:Supervisor_ID>
<ws:Supervisor_Name>Brandon Leonardo</ws:Supervisor_Name>
</ws:Supervisor>
</ws:Position>
<ws:Additional_Information>
<ws:Management_Level_Text>Individual Contributor</ws:Management_Level_Text>
<ws:Job_Profile_Text>Software Engineer</ws:Job_Profile_Text>
<ws:Location>San Francisco</ws:Location>
<ws:Company_Text>Maplebear dba Instacart</ws:Company_Text>
<ws:Cost_Center_Text>Engineering</ws:Cost_Center_Text>
</ws:Additional_Information>
</ws:Worker>
</ws:Worker_Sync> -
Hi,
It appears that you still had some difficulties with the mapping, in cases like this its important to use the Populate parent record. A good tip is using the root element of the data you need to extract for example in your case it would be Worker and then use Populate parent record for all the other element mappings.
I have attached the solution to the XML you sent me
Example.zip
Please sign in to leave a comment.
Comments 7