### Method

# GLib VariantDict lookup

since: 2.40

#### Declaration

    gboolean
    g_variant_dict_lookup (
      GVariantDict* dict,
      const gchar* key,
      const gchar* format_string,
      ...
    )

#### Description

Looks up a value in a `GVariantDict`.

This function is a wrapper around `g_variant_dict_lookup_value()` and g_variant_get(). In the case that `NULL` would have been returned, this function returns `FALSE` and does not modify the values of the arguments passed in to @…. Otherwise, it unpacks the returned value and returns `TRUE`.

`format_string` determines the C types that are used for unpacking the values and also determines if the values are copied or borrowed, see the section on `GVariant` format strings.

Available since: 2.40

This method is not directly available to language bindings.

#### Parameters

`key`

  Type: `const gchar*`

  The key to look up in the dictionary.

  The data is owned by the caller of the method.
  The value is a NUL terminated UTF-8 string.

`format_string`

  Type: `const gchar*`

  A GVariant format string.

  The data is owned by the caller of the method.
  The value is a NUL terminated UTF-8 string.

`...`

  Type: ``

  The arguments to unpack the value into.

#### Return value

Type: `gboolean`

`TRUE` if a value was unpacked.