# Using XPATH to get a a specific node

**URL:** <https://forum.uipath.com/t/using-xpath-to-get-a-a-specific-node/362609>\
**Category:** Activities\
**Tags:** xpath, xml, web, question, webapi, activities\
**Created:** [18 Noviembre, 2021 13:16 UTC](https://forum.uipath.com/t/using-xpath-to-get-a-a-specific-node/362609 "2021-11-18T13:16:45Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Amit\_Bendet](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/amit_bendet/32/65066_2.png) [@Amit\_Bendet](https://forum.uipath.com/u/Amit_Bendet)\
**Post date:** [18 Noviembre, 2021 13:16 UTC](https://forum.uipath.com/t/using-xpath-to-get-a-a-specific-node/362609/1 "2021-11-18T13:16:45Z")

</div>

Hi,  
I got an xml file that I need to work on (adding it in the end of the post).  
I need the retrieve the node “DocIDAutoNumerator” only when I find the node “DocumentTypeValue” = 1319.  
Is there a way to look it in just one XPATH?  
or should I look for DocumentTypeValue ==1319 and get the current position so I can make a XPATH using the location I just retrieved?  
Thank you all for your help!

the file is -

```
        <Document>
           <Labels>
              <Label>
                 <Fields>
                    <Field>
                       <Code>DocumentTypeValue</Code>
                       <Value>4008</Value>
                    </Field>
                    <Field>
                       <Code>DocIDAutoNumerator</Code>
                       <Value>123121</Value>
                    </Field>
                 </Fields>
              </Label>
           </Labels>
        </Document>

        <Document>
           <Labels>
              <Label>
                 <Fields>
                    <Field>
                       <Code>DocumentTypeValue</Code>
                       <Value>1319</Value>
                    </Field>
                    <Field>
                       <Code>DocIDAutoNumerator</Code>
                       <Value>21321</Value>
                    </Field>
                 </Fields>
              </Label>
           </Labels>
        </Document>

```

---

<div class="post-metadata">

**Author:** ![pikorpa](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/pikorpa/32/548059_2.png) [@pikorpa](https://forum.uipath.com/u/pikorpa)\
**Post date:** [18 Noviembre, 2021 17:23 UTC](https://forum.uipath.com/t/using-xpath-to-get-a-a-specific-node/362609/2 "2021-11-18T17:23:44Z")

</div>

Hey,  
I hope this workflow will be helpful for you:  
[communityXPATH.zip](https://forum.uipath.com/uploads/short-url/iJnHk6JjClFpJJEFWqOKZ5AkBv.zip) (2.9 KB)

---

<div class="post-metadata">

**Author:** ![Amit\_Bendet](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/amit_bendet/32/65066_2.png) [@Amit\_Bendet](https://forum.uipath.com/u/Amit_Bendet)\
**Post date:** [19 Noviembre, 2021 07:30 UTC](https://forum.uipath.com/t/using-xpath-to-get-a-a-specific-node/362609/3 "2021-11-19T07:30:14Z")

</div>

HI,  
Thank you for your quick reply!  
I managed to find the XPATH which made the best result -

```auto
//Fields[Field[Code="DocumentTypeValue"][Value="1319"]]
 /Field[Code="DocIDAutoNumerator"]/Value

```

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/system/32/182466_2.png) [@system](https://forum.uipath.com/u/system)\
**Post date:** [22 Noviembre, 2021 07:30 UTC](https://forum.uipath.com/t/using-xpath-to-get-a-a-specific-node/362609/4 "2021-11-22T07:30:34Z")

</div>

Cerrado el 22 Noviembre, 2021 07:30 UTC

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