div-action-set-stored-value

Temporarily saves the variable in storage.

Parameters

Parameters Description
lifetime

int

Required parameter.

Duration of storage in seconds.

Available platforms: Android, iOS, web.

name

string

Required parameter.

Name of the saved variable.

Available platforms: Android, iOS, web.

type

string

Required parameter.

The value must always be set_stored_value.

Available platforms: Android, iOS, web.

value

object

Required parameter.

Saved value.

The value has the type div-typed-value.

Available platforms: Android, iOS, web.

List of possible values:

  • string_value
  • integer_value
  • number_value
  • color_value
  • boolean_value
  • url_value
  • dict_value
  • array_value
  • scope

    string

    Scope of the stored variable:

  • global — not bound to a specific card (available for any card);
  • card — bound to the current card. On Android the card is identified by DivDataTag, on iOS by the cardId parameter, on Web the scope value is passed to Store and the developer integrating DivKit must implement saving variables for that scope.
  • /nDefault value for Android and iOS is global'. For Web, the implementation depends entirely on the developer.</p><p>Possible values: global, card`.

    Available platforms: Android, iOS, web.

    JSON
    {
      type*: "set_stored_value",
      lifetime*: "int",
      name*: "string",
      scope: "string",
      value*: div-typed-value
    }