# How to get the text of most recent comment

**URL:** <https://community.fibery.io/t/how-to-get-the-text-of-most-recent-comment/3171>\
**Category:** Get Help\
**Created:** [August 13, 2022, 11:35pm UTC](https://community.fibery.io/t/how-to-get-the-text-of-most-recent-comment/3171 "2022-08-13T23:35:06Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Magnum6](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/magnum6/32/4679_2.png) [@Magnum6](https://community.fibery.io/u/Magnum6)\
**Post date:** [August 13, 2022, 11:35pm UTC](https://community.fibery.io/t/how-to-get-the-text-of-most-recent-comment/3171/1 "2022-08-13T23:35:06Z")

</div>

I’m trying to do something seemingly simple, but can’t figure it out. I’m trying to setup a field that gives me the text of the most recent comment. I have this formula as a start:

`Comments.Sort([Creation Date]).Last()`

but I get a red error that says “Formula result type cannot be Comment”. I’m trying to be able to grab this text via Zapier to drop it as a comment into a Discord channel. Maybe formula is not the way to go, but I don’t see a way to grab the most recent comment via Zapier either.

---

<div class="post-metadata">

**Author:** ![HereBeBeasties](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/herebebeasties/32/5429_2.png) [@HereBeBeasties](https://community.fibery.io/u/HereBeBeasties)\
**Post date:** [August 15, 2022, 12:58am UTC](https://community.fibery.io/t/how-to-get-the-text-of-most-recent-comment/3171/2 "2022-08-15T00:58:35Z")

</div>

The comment is an object that has a number of fields on it, such at the text, the author, the timestamp, etc. Whereas presumably whatever you are passing this into is expecting a string?

---

<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:** [August 15, 2022, 8:47am UTC](https://community.fibery.io/t/how-to-get-the-text-of-most-recent-comment/3171/3 "2022-08-15T08:47:31Z")

</div>

I suggest using an automation with a script, something like this:

 ![image](https://us1.discourse-cdn.com/flex020/uploads/fibery/original/2X/5/590b405138653b5b9c513283a2cd2db89a099e55.png)  
The script is as follows:

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

for (const entity of args.currentEntities) {

    const entityWithExtraFields = await fibery.getEntityById(entity.type, entity.id, ['Comments']);
    const comments = entityWithExtraFields['Comments'];
    const lastComment = comments.pop();
    const content = await fibery.getDocumentContent(lastComment['Document Secret']);
    await fibery.updateEntity(entity.type, entity.id, { 'Field': content });
}

```

where Field is the name of a text field where the last comment text will go.

---

<div class="post-metadata">

**Author:** ![paul.a.matheson](https://avatars.discourse-cdn.com/v4/letter/p/87869e/32.png) [@paul.a.matheson](https://community.fibery.io/u/paul.a.matheson)\
**Post date:** [September 2, 2026, 11:47pm UTC](https://community.fibery.io/t/how-to-get-the-text-of-most-recent-comment/3171/4 "2026-09-02T23:47:24Z")

</div>

Is there a workaround for users on the free plan? Scripts are for paid users

---

<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:** [September 4, 2026, 5:55am UTC](https://community.fibery.io/t/how-to-get-the-text-of-most-recent-comment/3171/5 "2026-09-04T05:55:09Z")

</div>

> [@paul.a.matheson](#):
>
> Is there a workaround for users on the free plan?

At the moment, no. Sorry.
