# Como obtener el id de un documento?

**URL:** <https://community.ofelia.com/t/como-obtener-el-id-de-un-documento/7614>\
**Category:** Q&A\
**Created:** [18 July 2016 16:25 UTC](https://community.ofelia.com/t/como-obtener-el-id-de-un-documento/7614 "2016-07-18T16:25:00Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![claz08](https://avatars.discourse-cdn.com/v4/letter/c/5e9695/32.png) [@claz08](https://community.ofelia.com/u/claz08)\
**Post date:** [18 July 2016 16:25 UTC](https://community.ofelia.com/t/como-obtener-el-id-de-un-documento/7614/1 "2016-07-18T16:25:00Z")

</div>

Hola ,

Quisiera saber como puedo obtener el id de un documento recién adjunto mediante el widget de adjuntar.

Garcias

---

<div class="post-metadata">

**Author:** ![Sean\_McP](https://dub1.discourse-cdn.com/flex013/user_avatar/community.ofelia.com/sean_mcp/32/932_2.png) [@Sean\_McP](https://community.ofelia.com/u/Sean_McP)\
**Post date:** [19 July 2016 02:48 UTC](https://community.ofelia.com/t/como-obtener-el-id-de-un-documento/7614/2 "2016-07-19T02:48:09Z")

</div>

`
apiAccessor.getProcessAPI().getLastDocument(processInstanceId, "mainDoc").getId();
`

from [http://documentation.bonitasoft.com/documents-0](http://documentation.bonitasoft.com/documents-0)

also see  
[http://documentation.bonitasoft.com/handling-documents-0](http://documentation.bonitasoft.com/handling-documents-0)

regards  
Seán

PS: If this reply answers your question, please mark as resolved.

---

<div class="post-metadata">

**Author:** ![claz08](https://avatars.discourse-cdn.com/v4/letter/c/5e9695/32.png) [@claz08](https://community.ofelia.com/u/claz08)\
**Post date:** [19 July 2016 13:42 UTC](https://community.ofelia.com/t/como-obtener-el-id-de-un-documento/7614/3 "2016-07-19T13:42:25Z")

</div>

Thanks Sean!!

really helped me !

Do you know , if is possible to move the attached file to some other path?

Thanks again!!

---

<div class="post-metadata">

**Author:** ![Sean\_McP](https://dub1.discourse-cdn.com/flex013/user_avatar/community.ofelia.com/sean_mcp/32/932_2.png) [@Sean\_McP](https://community.ofelia.com/u/Sean_McP)\
**Post date:** [19 July 2016 20:17 UTC](https://community.ofelia.com/t/como-obtener-el-id-de-un-documento/7614/4 "2016-07-19T20:17:27Z")

</div>

See

[http://community.ofelia.com/questions-and-answers/how-i-can-move-file-has-been-attached-widget](http://community.ofelia.com/questions-and-answers/how-i-can-move-file-has-been-attached-widget)

Also please mark this question as resolved (Click the tick next to my answer), as it has, the other question will fix your other issue.

regards  
Seán
