# Save the value of a attribute in a GetElement.nm

**URL:** <https://discourse.openiap.io/t/save-the-value-of-a-attribute-in-a-getelement-nm/1916>\
**Category:** OpenRPA\
**Created:** [November 18, 2024, 6:10am UTC](https://discourse.openiap.io/t/save-the-value-of-a-attribute-in-a-getelement-nm/1916 "2024-11-18T06:10:10Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jorge\_Cortes](https://discourse.openiap.io/letter_avatar_proxy/v4/letter/j/46a35a/32.png) [@Jorge\_Cortes](https://discourse.openiap.io/u/Jorge_Cortes)\
**Post date:** [November 18, 2024, 6:10am UTC](https://discourse.openiap.io/t/save-the-value-of-a-attribute-in-a-getelement-nm/1916/1 "2024-11-18T06:10:10Z")

</div>

Hi!  
I try to save the value of a atributte, but i do not know how  
I use a Get element.nm activity with a xpath like this:

xpath: “div/div[last()]”

The element i can find it, and i can retrive de value in the “Item” variable, that is not the problem. What i need is save an attribute of the Div, is an pn\_id=“1234”, and the number always change, so every time that i ask for the last child that number change.

there are any way to save that value, of that attibute, to a variable to compare later?

---

<div class="post-metadata">

**Author:** ![JithinKrishnan](https://discourse.openiap.io/letter_avatar_proxy/v4/letter/j/e8c25b/32.png) [@JithinKrishnan](https://discourse.openiap.io/u/JithinKrishnan)\
**Post date:** [November 18, 2024, 6:33am UTC](https://discourse.openiap.io/t/save-the-value-of-a-attribute-in-a-getelement-nm/1916/2 "2024-11-18T06:33:03Z")

</div>

Hello Jorge,

Try using `item.Attributes("pn_id").ToString` as Value inside Assign activity to get the pn\_id attribute from the div.

---

<div class="post-metadata">

**Author:** ![Allan\_Zimmermann](https://discourse.openiap.io/user_avatar/discourse.openiap.io/allan_zimmermann/32/12_2.png) [@Allan\_Zimmermann](https://discourse.openiap.io/u/Allan_Zimmermann)\
**Post date:** [November 18, 2024, 4:55pm UTC](https://discourse.openiap.io/t/save-the-value-of-a-attribute-in-a-getelement-nm/1916/3 "2024-11-18T16:55:18Z")

</div>

Item.attributes is a hash table that should contain it.

---

<div class="post-metadata">

**Author:** ![Jorge\_Cortes](https://discourse.openiap.io/letter_avatar_proxy/v4/letter/j/46a35a/32.png) [@Jorge\_Cortes](https://discourse.openiap.io/u/Jorge_Cortes)\
**Post date:** [November 19, 2024, 4:03pm UTC](https://discourse.openiap.io/t/save-the-value-of-a-attribute-in-a-getelement-nm/1916/4 "2024-11-19T16:03:15Z")

</div>

thank you for the response, it work nice!

---

<div class="post-metadata">

**Author:** ![system](https://discourse.openiap.io/uploads/default/original/2X/a/a1ca7b164ac9a826839704d9ac82c7b5e6bcf557.png) [@system](https://discourse.openiap.io/u/system)\
**Post date:** [November 26, 2024, 4:03pm UTC](https://discourse.openiap.io/t/save-the-value-of-a-attribute-in-a-getelement-nm/1916/5 "2024-11-26T16:03:17Z")

</div>

Closed on November 26, 2024, 4:03pm UTC

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