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

> Macro (table-plus)
> 
> |  |  |  |  |
> | --- | --- | --- | --- |
> | **Syntax** | comalaSetState(pageId, workflowState, [comment]) | **Package** | comala |
> | **Alias** |  | **Pkg Usage** |  |

## Description

> Macro (excerpt)
> 
> Sets the workflow state of the page using the Comala Document Management add-on.

Sets the workflow state of the page using the Comala Document Management add-on.

## Parameters

> Macro (table-plus)
> 
> | Parameter name | Type | Required | Description |
> | --- | --- | --- | --- |
> | pageId | Integer | Yes | The selected page to change the workflow state on. |
> | workflowState | String | Yes | Name of the workflow state to be set to. |
> | comment | String | Yes | Comment to be added to the Comala workflow history. |

## Return Type

**Boolean**

## Example

```javascript
return comalaSetState(getPage("TST", "Demo Page"), "Approved", "Page was approved by: " + currentUserFullName());
```

Returns 'true'

## See also

> Macro (contentbylabel)