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

> Macro (table-plus)
> 
> |  |  |  |  |
> | --- | --- | --- | --- |
> | **Syntax** | editComment(commentId, comment) | **Package** |  |
> | **Alias** |  | **Pkg Usage** |  |

## Description

> Macro (excerpt)
> 
> Edits a comment with the specified id and text. Returns the comment representation after the edit.

Edits a comment with the specified id and text. Returns the comment representation after the edit.

## Return Type

**[CComment](https://appfire.atlassian.net/wiki/spaces/PSCONF/pages/15303915)**

## Examples

### Example 1

Edits the comment with id 11801 with the specified text.

```javascript
string newComm = "This comment was edited.";
return editComment(11801, newComm);
```

### Example 2

Edits a comment by adding new text to the old one.

```javascript
CComment ccomment = getCommentById(11801); 
string oldComm = ccomment["text"];
string newComm = oldComm + "\nEditing the comment";
return editComment(11801, newComm);
```

## See also

> Macro (contentbylabel)