cancel
Showing results for 
Search instead for 
Did you mean: 
npd
Nintex Newbie

XML to JSON

Jump to solution

Hi,

 

I'm currently using the 2013 Query XML action to extract information from the following example XML using xpath. I would like to do this in NWC and am after suggestions on the best way to achieve this. Converting the XML to JSON via an online converter (http://www.vadimtabakman.com/xml-to-json-converter.aspx) and using the Query JSON action in NWC does exactly what I need, however I'm unsure how to programatically perform the conversion as part of the workflow. Any suggestions?  

 

<?xml version="1.0" encoding="UTF-8"?>
<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>
<wsSmiley Tonguerior_Entry_Time>2019-03-19T20:00:17.694-07:00</wsSmiley Tonguerior_Entry_Time>
<ws:Current_Entry_Time>2019-03-20T08:00:17.692-07:00</ws:Current_Entry_Time>
<wsSmiley Tonguerior_Effective_Time>2019-04-02T00:00:00.000-07:00</wsSmiley Tonguerior_Effective_Time>
<ws:Current_Effective_Time>2019-04-03T00:00:00.000-07:00</ws:Current_Effective_Time>
<ws:Full_File>false</ws:Full_File>
<wsSmiley Very Happyocument_Retention_Policy>30</wsSmiley Very Happyocument_Retention_Policy>
<ws:Worker_Count>1</ws:Worker_Count>
</ws:Header>
<ws:Worker>
<wsSmiley Frustratedummary>
<ws:Employee_ID>12345678</ws:Employee_ID>
<ws:Name>Joe Bloggs</ws:Name>
</wsSmiley Frustratedummary>
<ws:Eligibility>true</ws:Eligibility>
<wsSmiley Tongueersonal>
<ws:Name_Data>
<ws:Name_Type>Legal</ws:Name_Type>
<ws:First_Name>Joe</ws:First_Name>
<ws:Last_Name>Bloggs</ws:Last_Name>
</ws:Name_Data>
<ws:Name_Data>
<ws:Name_Type>Preferred</ws:Name_Type>
<ws:First_Name>Joe</ws:First_Name>
<ws:Last_Name>Bloggs</ws:Last_Name>
</ws:Name_Data>
<ws:Address_Data>
<ws:Address_Line_Data ws:Label="Address Line 1" ws:Type="ADDRESS_LINE_1">Test Office Address1</ws:Address_Line_Data>
<ws:Address_Line_Data ws:Label="Address Line 2" ws:Type="ADDRESS_LINE_2">Test Office Address2</ws:Address_Line_Data>
<ws:Municipality>London</ws:Municipality>
<ws:Country>UK</ws:Country>
</ws:Address_Data>
<ws:Email_Data>
<ws:Is_Primary>true</ws:Is_Primary>
<ws:Email_Address>joe.bloggs@testcompany.com</ws:Email_Address>
</ws:Email_Data>
</wsSmiley Tongueersonal>
<wsSmiley Frustratedtatus>
<ws:Employee_Status>Active</ws:Employee_Status>
<ws:Hire_Date>2019-03-21</ws:Hire_Date>
<wsSmiley Surprisedriginal_Hire_Date wsSmiley TongueriorValue="2018-05-07">2019-03-21</wsSmiley Surprisedriginal_Hire_Date>
</wsSmiley Frustratedtatus>
<wsSmiley Tongueosition>
<wsSmiley Surprisedperation>NONE</wsSmiley Surprisedperation>
<wsSmiley Tonguerimary_Position>true</wsSmiley Tonguerimary_Position>
<ws:Business_Title>Developer</ws:Business_Title>
<wsSmiley Surprisedrganization_Data>
<wsSmiley Surprisedperation>NONE</wsSmiley Surprisedperation>
<wsSmiley Surprisedrganization>TestOrg</wsSmiley Surprisedrganization>
<wsSmiley Surprisedrganization_Type>Function</wsSmiley Surprisedrganization_Type>
</wsSmiley Surprisedrganization_Data>
<ws:Business_Site>12345</ws:Business_Site>
<wsSmiley Frustratedupervisor>
<wsSmiley Surprisedperation>NONE</wsSmiley Surprisedperation>
<wsSmiley Frustratedupervisor_ID>87654321</wsSmiley Frustratedupervisor_ID>
<wsSmiley Frustratedupervisor_Name>Jane Doe</wsSmiley Frustratedupervisor_Name>
</wsSmiley Frustratedupervisor>
</wsSmiley Tongueosition>
<ws:Additional_Information>
<ws:Manager_Email>jane.doe@testcompany.com</ws:Manager_Email>
<ws:Location_Country>United Kingdom</ws:Location_Country>
<ws:Cost_center>Test Company Cost Centre</ws:Cost_center>
<ws:Company_Name>Test Company</ws:Company_Name>
<wsSmiley Frustratedupervisory_Name>DOE: Test Company (Jane Doe (12345678))</wsSmiley Frustratedupervisory_Name>
</ws:Additional_Information>
</ws:Worker>

</ws:Worker_Sync>

Labels: (1)
0 Kudos
Reply
1 Reply
npd
Nintex Newbie

Re: XML to JSON

Jump to solution

OK so I've found this which is useful but it would be good to get a query XML action in NWC. 

0 Kudos
Reply