# Xpath query to get the uuid from preview node

**URL:** <https://community.bloomreach.com/t/xpath-query-to-get-the-uuid-from-preview-node/1549>\
**Category:** Experience Manager (PaaS/OnPrem)\
**Created:** [November 7, 2019, 5:34pm UTC](https://community.bloomreach.com/t/xpath-query-to-get-the-uuid-from-preview-node/1549 "2019-11-07T17:34:50Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![girijanandan](https://yyz1.discourse-cdn.com/flex027/user_avatar/community.bloomreach.com/girijanandan/32/505_2.png) [@girijanandan](https://community.bloomreach.com/u/girijanandan)\
**Post date:** [November 7, 2019, 5:34pm UTC](https://community.bloomreach.com/t/xpath-query-to-get-the-uuid-from-preview-node/1549/1 "2019-11-07T17:34:50Z")

</div>

Hi,  
I want to take preview page uuid from preview node(myproject-preview) by page name ‘testpage’  
My node path is " [/hst:hst/hst:configurations/myproject-preview/hst:workspace/hst:sitemap/testpage] "  
Can you please help me by sending the xpath query for getting the page uuid by passing the page name from the preview node.

Thanks !

---

<div class="post-metadata">

**Author:** ![woonsanko](https://avatars.discourse-cdn.com/v4/letter/w/b5a626/32.png) [@woonsanko](https://community.bloomreach.com/u/woonsanko)\
**Post date:** [November 13, 2019, 2:41pm UTC](https://community.bloomreach.com/t/xpath-query-to-get-the-uuid-from-preview-node/1549/2 "2019-11-13T14:41:55Z")

</div>

> [@girijanandan](#):
>
> I want to take preview page uuid from preview node(myproject-preview) by page name ‘testpage’  
> My node path is " [/hst:hst/hst:configurations/myproject-preview/hst:workspace/hst:sitemap/testpage] "  
> Can you please help me by sending the xpath query for getting the page uuid by passing the page name from the preview node.

```auto
final Query query = session.getWorkspace().getQueryManager().createQuery("/jcr:root/hst:hst/hst:configurations/myproject-preview/hst:workspace/hst:sitemap/testpage", Query.XPATH);
final QueryResult result = query.execute();
final String nodeId = result.getNodes().nextNode().getIdentifier();

```
