Skip to main content
Skip table of contents

Sample Formulas - Comments

Show the date, author, and text of the latest comment

CODE
comments.UMAX_BY($.created).map(CONCAT(
	$.author.user_display_name(),
	" said at ",
	FORMAT_DATETIME($.created, "yyyy-MM-dd HH:mm:ss"),
	": ", $.body))

Show the last comment made by a user

CODE
comments.FILTER($.author = "admin").UMAX_BY($.created)

In this example, the last comment made by "admin" will be shown. To show comments for another user, replace "admin" accordingly.

Show the date of the latest comment done by a user

CODE
comments.filter(x -> x.author = "admin").map(x -> x.created).max()

In this example, the date corresponds to the last comment made by "admin." To show the date for another user, replace "admin" accordingly.

Display "Answered" if there are comments after my latest one

CODE
WITH myLastCommentDate = comments.FILTER($.author = me()).MAP($.created).MAX() :
   IF (comments.ANY($.created > myLastCommentDate); "Answered")
JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.