> Markdown versions of all pages of this connector library are available by appending `.md` to the page URL. For the full index of connectors, see [llms.txt](https://connectors.appmixer.com/llms.txt).

# appmixer.utils.controls.Counter

- Component: `appmixer.utils.controls.Counter`
- Kind: Action
- Version: 1.0.0
- Visibility: Public
- Connector: [appmixer.utils.controls 1.14.7](https://connectors.appmixer.com/connector/appmixer.utils.controls/1.14.7.md)
- Component page: <https://connectors.appmixer.com/connector/appmixer.utils.controls/1.14.7/component/appmixer.utils.controls.Counter>

Increments an internal counter every time a new message arrives and sends the new number to its output port.

## Properties

| Field | Type | Description |
| --- | --- | --- |
| Initial value (`count`) | number | - |
| Increment (`increment`) | number | Can be negative for decrement. |

## Input ports

### Port `item`

_No fields defined for this port._

### Port `reset`

| Field | Type | Description |
| --- | --- | --- |
| Value (`count`) | number | The value the Counter will be reset to. If not specified, the Counter will be reset to the initial value. |

## Output ports

### Port `count`

| Field | Type | Description |
| --- | --- | --- |
| Items count (`count`) | - | - |

## Full metadata (component.json)

```json
{
  "name": "appmixer.utils.controls.Counter",
  "author": "Martin Krčmář <martin@client.io>",
  "description": "Increments an internal counter every time a new message arrives and sends the new number to its output port.",
  "icon": "(data URI omitted)",
  "private": false,
  "properties": {
    "schema": {
      "properties": {
        "count": {
          "type": "number"
        },
        "increment": {
          "type": "number"
        }
      },
      "required": [
        "count",
        "increment"
      ]
    },
    "inspector": {
      "inputs": {
        "count": {
          "type": "number",
          "index": 1,
          "label": "Initial value",
          "defaultValue": 0
        },
        "increment": {
          "type": "number",
          "index": 2,
          "label": "Increment",
          "defaultValue": 1,
          "tooltip": "Can be negative for decrement."
        }
      }
    }
  },
  "inPorts": [
    {
      "name": "item"
    },
    {
      "name": "reset",
      "schema": {
        "type": "object",
        "properties": {
          "count": {
            "type": "number"
          }
        }
      },
      "inspector": {
        "inputs": {
          "count": {
            "type": "number",
            "tooltip": "The value the Counter will be reset to. If not specified, the Counter will be reset to the initial value.",
            "label": "Value",
            "index": 1
          }
        }
      }
    }
  ],
  "outPorts": [
    {
      "name": "count",
      "schema": {
        "properties": {
          "count": {
            "type": "number"
          }
        },
        "required": [
          "count"
        ]
      },
      "options": [
        {
          "label": "Items count",
          "value": "count"
        }
      ]
    }
  ]
}
```
