Parse Descriptors in XML Output

Hello Everyone, Could you please help me in extracting the descriptor values from the below mentioned xml output. I need to extract values such as chennai, new delhi, kolkata etc.

<env:Envelope xmlns:env=“http://schemas.xmlsoap.org/soap/envelope/”>
env:Body
<wd:Get_Organizations_Response wd:version=“v33.2” xmlns:wd=“urn:com.workday/bsvc”>
wd:Request_References
<wd:Organization_Reference wd:Descriptor=“Chennai”>
<wd:ID wd:type=“WID”>7904fb95b0a9011c598d622545680</wd:ID>
<wd:ID wd:type=“Organization_Reference_ID”>530269</wd:ID>
</wd:Organization_Reference>
</wd:Request_References>
wd:Response_Group
wd:Include_Roles_Data0</wd:Include_Roles_Data>
wd:Include_Hierarchy_Data1</wd:Include_Hierarchy_Data>
wd:Include_Supervisory_Data0</wd:Include_Supervisory_Data>
wd:Include_Staffing_Restrictions_Data0</wd:Include_Staffing_Restrictions_Data>
</wd:Response_Group>
wd:Response_Results
wd:Total_Results1</wd:Total_Results>
wd:Total_Pages1</wd:Total_Pages>
wd:Page_Results1</wd:Page_Results>
wd:Page1</wd:Page>
</wd:Response_Results>
wd:Response_Data
wd:Organization

              <wd:Hierarchy_Data>
                 <wd:Top-Level_Organization_Reference wd:Descriptor="Kolkata">
                    <wd:ID wd:type="WID">def6fe28d9a210a6cdff2d717df6a</wd:ID>
                    <wd:ID wd:type="Organization_Reference_ID">523852_1</wd:ID>
                 </wd:Top-Level_Organization_Reference>
                 <wd:Superior_Organization_Reference wd:Descriptor="New Delhi">
                    <wd:ID wd:type="WID">def6fe28d9a210a6ce1343299f8d8</wd:ID>
                    <wd:ID wd:type="Organization_Reference_ID">523284</wd:ID>
                 </wd:Superior_Organization_Reference>
                 <wd:Subordinate_Organization_Reference wd:Descriptor="Hyderabad">
                    <wd:ID wd:type="WID">b42f955578ec0109da2dc4c213be7</wd:ID>
                    <wd:ID wd:type="Organization_Reference_ID">534820</wd:ID>
                 </wd:Subordinate_Organization_Reference>
                 <wd:Subordinate_Organization_Reference wd:Descriptor="Bangalore">
                    <wd:ID wd:type="WID">b42f955578ec012cefc1d4c21e3e6</wd:ID>
                    <wd:ID wd:type="Organization_Reference_ID">530819</wd:ID>
                 </wd:Subordinate_Organization_Reference>
                 <wd:Subordinate_Organization_Reference wd:Descriptor="Jaipur">
                    <wd:ID wd:type="WID">7904fb95b0a901a2663fcc2547c80</wd:ID>
                    <wd:ID wd:type="Organization_Reference_ID">530070</wd:ID>
                 </wd:Subordinate_Organization_Reference>
              </wd:Hierarchy_Data>
           </wd:Organization_Data>
        </wd:Organization>
     </wd:Response_Data>
  </wd:Get_Organizations_Response>

</env:Body>
</env:Envelope>

PFATest.txt (3.0 KB)

@bassu727
find starter help here:
NamespaceInElementAndAttribute.xaml (7.4 KB)
working with this fixed element (refer to your sample to lin 46/47 for the wrong element which was to remove)
Test.xml (2.9 KB)

Doing this logging:
grafik

Ensure: UiPath.WebApi.Activities is included voa the Dependecy Manager

Let us know your feedback

Hello @ppr,

Thanks for your response. I am getting the response. Adding to it if I have to get the element names of the Hierarchy_Data (Top-Level_Organization_Reference,Superior_Organization_Reference,Subordinate_Organization_Reference), then how can we get them?

Thanks inadvance,
@bassu727

@bassu727
we can get the names e.g. with XelementVar.Name.LocalName

Have a look here:

Adding this additional log message will produce:
grafik

Thank you @ppr. It’s working.

@bassu727
Perfect,

Also have a look here:

maybe you want to apply this approach to the middle part retrieving (This one with the many Elements…Elements…Elements) as it is more asy to read and to maintain)

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.