---
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: 148
product: Flux
version: v0
publisher: InfluxData
canonical: https://docs.influxdata.com/flux/v0/stdlib/pagerduty/actionfromlevel/
date: '2024-04-08T16:01:02-06:00'
lastmod: '2024-04-08T16:01:02-06:00'
---

* Flux 0.43.0+

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

```
import "pagerduty"

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

```
