> For the complete documentation index, see [llms.txt](/llms.txt).

- Snap

# snap_getInterfaceState

Get the form state of an [interface](https://metamask-docs-f8nytczy3-consensys-ddffed67.vercel.app/snaps/features/custom-ui/interactive-ui/)created by [snap_createInterface](https://metamask-docs-f8nytczy3-consensys-ddffed67.vercel.app/snaps/reference/snaps-api/snap%5Fcreateinterface).

## Parameters[​](#parameters "Direct link to Parameters")

object

required

An object containing the parameters for the `snap_getInterfaceState` method.

### id

string

required

The interface ID.

## Returns[​](#returns "Direct link to Returns")

Record<string, { addresses: \`${string}:${string}:${string}\`[]; accountId: string } | { name: string; size: number; contentType: string; contents: string } | { symbol: string; name: string; asset: \`${string}:${string}/${string}:${string}\` } | boolean | Record<string, { addresses: \`${string}:${string}:${string}\`[]; accountId: string } | { name: string; size: number; contentType: string; contents: string } | { symbol: string; name: string; asset: \`${string}:${string}/${string}:${string}\` } | boolean | string | null> | string | null>

The state of the given interface. This is a `Record` of the form state, where the keys are the `name` properties of the form fields, and the values are the current values of those fields, depending on the type of the field.

For example, for a text field, the value would be a `string`, for a checkbox field, the value would be a `boolean`, and for a file upload field, the value would be a `File` object. The exact structure of the state depends on the form fields that were defined when the interface was created.

## Example

```
const state = await snap.request({
  method: 'snap_getInterfaceState',
  params: {
    id: interfaceId,
  },
})

```
