1. Home
  2. Docs
  3. Functions
  4. Working with function state

Working with function state

Functions can update state when they execute. For example, a function can increment a counter or set a metric value.

Viewing current state value

To view the current value of a state key associated with a function:

  1. From the left sidebar menu, select Functions/Manage.
  2. Find the function you would like to delete. You can filter the listed functions by name, runtime, and namespace. Once you find the function, click on the Manage button.
  3. You should now see the details of the function. Click on the State button at the bottom of the screen.
  4. Enter the name of the key you want to retrieve in the Key field.
  5. Click on the Get button.
  6. The current value of the key is displayed along with its type and version number.

Setting a state value

To set the value of a state key associated with a function:

  1. From the left sidebar menu, select Functions/Manage.
  2. Find the function you would like to delete. You can filter the listed functions by name, runtime, and namespace. Once you find the function, click on the Manage button.
  3. You should now see the details of the function. Click on the State button at the bottom of the screen.
  4. Enter the name of the key you want to set in the Key field.
  5. Enter a value for the key in the Value field.
  6. Select a type for the key in the Type field.
  7. Click on the Set button.
  8. The key is set to the value and the version number is updated in the Version field.
Was this article helpful to you? Yes No

How can we help?