# How to get the IElement of a IEntityInstance?

**URL:** https://discourse.geta12.com/t/how-to-get-the-ielement-of-a-ientityinstance/609
**Category:** Kernel
**Tags:** 2022-06, 2022-02, 2021-06
**Created:** [August 25, 2022, 6:58am UTC](https://discourse.geta12.com/t/how-to-get-the-ielement-of-a-ientityinstance/609 "2022-08-25T06:58:48Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![andreas-fresh-mesa](https://discourse.geta12.com/letter_avatar_proxy/v4/letter/a/a87d85/32.png) [@andreas-fresh-mesa](https://discourse.geta12.com/u/andreas-fresh-mesa)
#### Post date: [August 25, 2022, 6:58am UTC](https://discourse.geta12.com/t/how-to-get-the-ielement-of-a-ientityinstance/609/1 "2022-08-25T06:58:48Z")

</div>

I have a IEntityInstance at hand and would like to get the IElement instance of the corresponding model of it. Does A12 provide any utility that I can use for this? I haven’t had any success in finding anything.

---

<div class="post-metadata">

### Author: ![jan-static-daemon](https://discourse.geta12.com/letter_avatar_proxy/v4/letter/j/dbc845/32.png) [@jan-static-daemon](https://discourse.geta12.com/u/jan-static-daemon)
#### Post date: [August 26, 2022, 9:43am UTC](https://discourse.geta12.com/t/how-to-get-the-ielement-of-a-ientityinstance/609/2 "2022-08-26T09:43:35Z")

</div>

Moin,  
you could create an instance of `IDocumentModelSearchService` from Kernel via `DocumentModelServiceFactory` and use the `getByPath`-method, which takes a path (from `IEntityInstance`) and returns an optional of `IElement`.

I’ve checked for 2022.02 and 2022.06 version of A12.

 ![Bildschirmfoto 2022-08-26 um 11.40.54](https://discourse.geta12.com/uploads/default/original/1X/5b863952dabae4dec8c986477a3d2a8285daaaaa.png)

---

<div class="post-metadata">

### Author: ![andreas-fresh-mesa](https://discourse.geta12.com/letter_avatar_proxy/v4/letter/a/a87d85/32.png) [@andreas-fresh-mesa](https://discourse.geta12.com/u/andreas-fresh-mesa)
#### Post date: [August 26, 2022, 9:56am UTC](https://discourse.geta12.com/t/how-to-get-the-ielement-of-a-ientityinstance/609/3 "2022-08-26T09:56:41Z")

</div>

Solution above also works for 2021.06

---

<div class="post-metadata">

### Author: ![system](https://discourse.geta12.com/user_avatar/discourse.geta12.com/system/32/2016_2.png) [@system](https://discourse.geta12.com/u/system)
#### Post date: [September 9, 2022, 9:56am UTC](https://discourse.geta12.com/t/how-to-get-the-ielement-of-a-ientityinstance/609/4 "2022-09-09T09:56:44Z")

</div>

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