# How to retrieve a linked entity from Rich Text via its markdown?

**URL:** <https://community.fibery.io/t/how-to-retrieve-a-linked-entity-from-rich-text-via-its-markdown/2822>\
**Category:** Get Help\
**Tags:** automations, rich-text\
**Created:** [May 18, 2022, 10:19pm UTC](https://community.fibery.io/t/how-to-retrieve-a-linked-entity-from-rich-text-via-its-markdown/2822 "2022-05-18T22:19:47Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Matt\_Blais](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/matt_blais/32/1464_2.png) [@Matt\_Blais](https://community.fibery.io/u/Matt_Blais)\
**Post date:** [May 18, 2022, 10:19pm UTC](https://community.fibery.io/t/how-to-retrieve-a-linked-entity-from-rich-text-via-its-markdown/2822/1 "2022-05-18T22:19:47Z")

</div>

In Rich Text a linked entity looks something like this when exported to Markdown:

`[[#^7517bc49-058a-4533-850e-67b7894c6f2e/bec1ecb0-172d-11ec-a8bb-d12073fec656]]`

How can I translate this into a Type and Id that I can use with `getEntityById()`?

If I interpret the string as `[[#^type/id]]`, I get:  
`Failed to execute Action "Script": type 7517bc49-058a-4533-850e-67b7894c6f2e was not found in schema`

---

<div class="post-metadata">

**Author:** ![Chr1sG](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/chr1sg/32/3941_2.png) [@Chr1sG](https://community.fibery.io/u/Chr1sG)\
**Post date:** [May 19, 2022, 6:09am UTC](https://community.fibery.io/t/how-to-retrieve-a-linked-entity-from-rich-text-via-its-markdown/2822/2 "2022-05-19T06:09:37Z")

</div>

The name of the type can be found as follows:

```auto
const fibery = context.getService('fibery');
const schema = await fibery.getSchema();
const typeName = schema.typeObjects.filter((obj) => obj.id == '7517bc49-058a-4533-850e-67b7894c6f2e')[0].name;
console.log(typeName);

```

You can then use the type name in all the normal script functions 🙂

---

<div class="post-metadata">

**Author:** ![Matt\_Blais](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/matt_blais/32/1464_2.png) [@Matt\_Blais](https://community.fibery.io/u/Matt_Blais)\
**Post date:** [May 19, 2022, 3:30pm UTC](https://community.fibery.io/t/how-to-retrieve-a-linked-entity-from-rich-text-via-its-markdown/2822/3 "2022-05-19T15:30:11Z")

</div>

The entity info (and type) will vary, so I suppose I need to look up the type for each one.
