# \[Done\] Get notification about the comment

**URL:** <https://community.fibery.io/t/done-get-notification-about-the-comment/2684>\
**Category:** API & Programming\
**Created:** [April 5, 2022, 10:41am UTC](https://community.fibery.io/t/done-get-notification-about-the-comment/2684 "2022-04-05T10:41:45Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Polina\_Zenevich](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/polina_zenevich/32/480_2.png) [@Polina\_Zenevich](https://community.fibery.io/u/Polina_Zenevich)\
**Post date:** [April 5, 2022, 10:41am UTC](https://community.fibery.io/t/done-get-notification-about-the-comment/2684/1 "2022-04-05T10:41:45Z")

</div>

We have a couple of requests from users, so we decided to share this workaround with you. If anyone has comments, questions, or better ways - please, feel free to share them here on this topic 🙂

The content about the comment can be retrieved using script using \<% %\> inside the notification body

 ![image](https://us1.discourse-cdn.com/flex020/uploads/fibery/original/2X/2/2bfd0680181d15a5e3d20e2ca2a43fe1d0696506.png)

Comment is added:

```auto
<%

const fibery = context.getService('fibery');

const entity = await fibery.getEntityById(Entity.Type, Entity.Id, ['Comments']);

const documentSecret = entity.Comments[entity.Comments.length - 1]['Document Secret'];

const commentContent = await fibery.getDocumentContent(documentSecret);

%><%= commentContent%>

```

And this is how the result looks like

 ![image](https://us1.discourse-cdn.com/flex020/uploads/fibery/original/2X/9/9f15d9b90d28d26cdc38799e61785fd02b399252.png)

---

<div class="post-metadata">

**Author:** ![Polina\_Zenevich](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/polina_zenevich/32/480_2.png) [@Polina\_Zenevich](https://community.fibery.io/u/Polina_Zenevich)\
**Post date:** [April 14, 2022, 2:14pm UTC](https://community.fibery.io/t/done-get-notification-about-the-comment/2684/2 "2022-04-14T14:14:40Z")

</div>

Easier way added ad-hoc, you can check details [in this Changelog post](https://community.fibery.io/t/changelog-april-12-pinned-state-and-assignment-fields-read-only-users-can-add-comments/2707)

---

<div class="post-metadata">

**Author:** ![yala](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/yala/32/5432_2.png) [@yala](https://community.fibery.io/u/yala)\
**Post date:** [August 30, 2022, 5:57pm UTC](https://community.fibery.io/t/done-get-notification-about-the-comment/2684/3 "2022-08-30T17:57:50Z")

</div>

What is useful to add here, is that notifications for people assigned to an Entity, if said column exists, can already receive notifications:

 ![Screenshot 2022-08-30 at 19-15-54 Build your company workspace with no code](https://us1.discourse-cdn.com/flex020/uploads/fibery/original/2X/d/d40cf1c4e80d786589b48a858b42953958ab05d6.png)

Also:

> [@\[FIXED\] @mention in comments creating two notifications](https://community.fibery.io/t/fixed-mention-in-comments-creating-two-notifications/1554/5):
>
> It is obvious Notifications are not a strong part of Fibery, however, we’ll postpone notifications improvements for some time. In terms of polishing, we will focus on the
> 
> - entity view re-design
> - permissions
> - rich edit field
> - table view
> - timeline view
> - My Space.
> 
> I hope we’ll get to notifications eventually, but it’s hard to promise, since they don’t popup on top in our feedback loops.

> [@Notification about new comments](https://community.fibery.io/t/notification-about-new-comments/2396/2):
>
> The ability to “follow entity” is in the backlog

And also:

> [@Polina\_Zenevich](#):
>
> Easier way added ad-hoc

It appears this comment refers to the headline [🤖 Automations: Rich text fields can be used in templates](https://community.fibery.io/t/changelog-april-12-pinned-state-and-assignment-fields-read-only-users-can-add-comments/2707#automations-rich-text-fields-can-be-used-in-templates-4). Is this correct?

Then this is also documented in the headline **Using entity fields** on

`https://the.fibery.io/@public/User_Guide/Guide/Markdown-templates-53/anchor=Using-entity-fields--051b5b02-7c45-4aaa-8a1d-8d0066d402e1`

and the headline **Using rich text fields**

`https://the.fibery.io/@public/User_Guide/Guide/Markdown-templates-53/anchor=Using-rich-text-fields--2f28d99c-6af4-4aa8-86eb-1e24a1f06d1e`

Here this eventually needs additional logic via JavaScript to fetch the last comment, which is explained under **More complex formatting**

`https://the.fibery.io/@public/User_Guide/Guide/Markdown-templates-53/anchor=More-complex-formatting--6c28d440-c881-4be1-9f93-b11d7be82cd1`

There are is also an example for Slack, which uses a similar, “complicated” notation as in the example above.

With all the above taken together, it is not clear to me how a “more easy template” could look like.

@Polina_Zenevich Could you provide an example, about how one can simplify the printing of a comment’s text into a notification, in so it appears similarly as above?

---

<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:** [October 4, 2024, 7:00am UTC](https://community.fibery.io/t/done-get-notification-about-the-comment/2684/4 "2024-10-04T07:00:06Z")

</div>


