---
title: pagerduty.actionFromLevel() function
description: pagerduty.actionFromLevel() converts a monitoring level to a PagerDuty action.
url: https://docs.influxdata.com/flux/v0/stdlib/pagerduty/actionfromlevel/
estimated_tokens: 480
product: Flux
version: v0
---

# pagerduty.actionFromLevel() function

-   Flux 0.43.0+
-   View InfluxDB support

`pagerduty.actionFromLevel()` converts a monitoring level to a PagerDuty action.

-   `ok` converts to `resolve`.
-   All other levels convert to `trigger`.

##### Function type signature

```js
(level: string) => string
```

For more information, see [Function type signatures](/flux/v0/function-type-signatures/).

## Parameters

### level

(Required) Monitoring level to convert to a PagerDuty action.

## Examples

### Convert a monitoring level to a PagerDuty action

```js
import "pagerduty"

pagerduty.actionFromLevel(level: "crit")// Returns trigger

```
