---
title: "getCommentById"
canonical: "https://support.appfire.com/space/PSCONF/15304928/getCommentById"
format: markdown
---
> Macro (aura-html)

> Macro (table-plus)
> 
> |  |  |  |  |
> | --- | --- | --- | --- |
> | **Syntax** | getCommentById(id) | **Package** |  |
> | **Alias** |  | **Pkg Usage** |  |

## Description

> Macro (excerpt)
> 
> Gets all the comment properties for a given id.

Gets all the comment properties for a given id.

## Parameters

> Macro (table-plus)
> 
> | Parameter name | Type | Required | Description |
> | --- | --- | --- | --- |
> | comment ID | Number | Yes | Id of the page comment |

## Return Type

**CComment**

## Example

Deletes all comments older than 1 year from page ID 11801.

```javascript
number [] allComm = getAllCommentIds(11801);
interval year = "365d";
for(number c in allComm) {
	CComment comm = getCommentById(c);
	if(comm.created < (currentDate - year)) {
		deleteComment(c)
	}
}
```

## See also

> Macro (contentbylabel)