---
title: "state-selection macro"
canonical: "https://support.appfire.com/space/CDML/649826719/state-selection%20macro"
format: markdown
---
> Macro (aura-html)


## Overview

> Macro (excerpt)
> 
> Specify direct state transitions

The `state-selection` macro adds one or more direct state transition buttons to the [workflow popup](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649659846).

## Where to use it?

Optional.

One or more `state-selection` macros can be added to a **[state](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649531575)**[ macro](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649531575)


> ℹ️ A state-selection cannot be used when the `state` includes an **[approval](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649662337)**[ macro](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649662337).

## Parameters

| **Parameter** | **Required** | **Default** | **Notes** |
| --- | --- | --- | --- |
| `states` | :check_mark: |  | Comma-delimited list of states to display in the current state. All states listed must be defined with a ` `[{state}](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649531575)` ` macro in the current workflow.<br>> Macro (contentbylabel) |
| *[Conditions](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649694110)* |  |  | Set the conditions that have to be met in order to change the state. If no conditions are set, then any user who has permission to see draft versions can change the state.<br>> Macro (contentbylabel) |

## Events

The following [Events](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649759655) arise from state transitions:

- `statechanged`
- `pagestatechanged`
- `newsstatechanged`

## Example

```plaintext
{workflow:name=Example}
   {state:In Progress}
      {state-selection:states=Review,Cancelled}
   {state}
   {state:Cancelled}
   {state}
   {state:Review}
   {state}
   {state:Published}
   {state}
{workflow}
```

When using more than one state-selection macro can add each one with a different condition.

```
{workflow:name=Example}
   {state:In Progress}
      {state-selection:states=Review,user=user1}
        {state-selection:states=Review, Cancelled,user=user2}
   {state}
   {state:Cancelled}
   {state}
   {state:Review}
   {state}
   {state:Published}
   {state}
{workflow}
```

In the example, for the destination state for the transition:

- `user1` can only select the **Review **state
- `user2` can only select the **Review **or the **Cancelled **state

[Workflow Authoring Guide](https://appfire.atlassian.net/wiki/spaces/CDML/pages/648611901):

- [States](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649595551)
- [Transitions](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649563425)
- [Events](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649759655)
- [Triggers](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649563178)
- [Actions](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649858941)

[User Guide](https://appfire.atlassian.net/wiki/spaces/CDML/pages/648907144):

- [Workflow Status Bar](https://appfire.atlassian.net/wiki/spaces/CDML/pages/650117676)
- [Workflow Popup](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649659846)

[Reporting Guide](https://appfire.atlassian.net/wiki/spaces/CDML/pages/649070833):

- [Report on states](https://appfire.atlassian.net/wiki/spaces/CDML/pages/650216427)