# How to create a global variable where the response contains duplicate tags?

**URL:** <https://community.postman.com/t/how-to-create-a-global-variable-where-the-response-contains-duplicate-tags/14012>\
**Category:** Help Hub\
**Created:** [July 9, 2020, 10:15am UTC](https://community.postman.com/t/how-to-create-a-global-variable-where-the-response-contains-duplicate-tags/14012 "2020-07-09T10:15:26Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![JoshBl](https://avatars.discourse-cdn.com/v4/letter/j/4491bb/32.png) [@JoshBl](https://community.postman.com/u/JoshBl)\
**Post date:** [July 9, 2020, 10:15am UTC](https://community.postman.com/t/how-to-create-a-global-variable-where-the-response-contains-duplicate-tags/14012/1 "2020-07-09T10:15:26Z")

</div>

Hi all,

I’m trying to create a global variable based on the response of a POST request. However, the response contains duplicate XML tags - which makes it difficult to assert.  
Like so:

```auto
<Field>
   <Name>Field 1</Name>
   <Value>ABC</Value>
</Field>
<Field>
   <Name>Field 2</Name>
   <Value>123</Value>
</Field>

```

How can I assign the value of 123 to a global variable?

---

<div class="post-metadata">

**Author:** ![vdespa](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/vdespa/32/2770_2.png) [@vdespa](https://community.postman.com/u/vdespa)\
**Post date:** [July 10, 2020, 2:36am UTC](https://community.postman.com/t/how-to-create-a-global-variable-where-the-response-contains-duplicate-tags/14012/2 "2020-07-10T02:36:22Z")

</div>

Once you transform this XML response to JavaScript, you could search for the field with the name “Field 2” and identify the value. Would this work for you?
