> ## Documentation Index
> Fetch the complete documentation index at: https://docs.firstresonance.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Update run step fields

> Query the fields on a run step and update a field value with the GraphQL API.

To update a field on a run step, first query the run to find the field you want, then run a mutation to set its value.

## Get the fields

Query the run to get the fields that exist on the run steps you want to update:

```graphql theme={null}
{
  run(id: 419) {
    id steps {
      id fields {
        id name value type _etag
      }
    }
  }
}
```

The response looks like this:

```json theme={null}
{
  "data": {
    "run": {
      "id": 419,
      "steps": [
        {
          "id": 1429,
          "fields": [
            {
              "id": 1461,
              "name": "required_field",
              "value": null,
              "type": "STRING",
              "_etag": "066b1eb08dab44d6925d7bbd899e92cf"
            },
            {
              "id": 1462,
              "name": "pass_fail",
              "value": null,
              "type": "BOOLEAN",
              "_etag": "066b1eb08dab44d6925d7bbd899e92cf"
            },
            {
              "id": 1463,
              "name": "quality",
              "value": null,
              "type": "SIGNOFF",
              "_etag": "066b1eb08dab44d6925d7bbd899e92cf"
            }
          ]
        }
      ]
    }
  }
}
```

The query returns a list of run steps within that run, and the fields within those run steps. Find the field that you want to update.

## Update a field value

From the example response above, suppose you want to update field `1462` because your test equipment can determine pass or fail. Use this mutation:

```graphql theme={null}
mutation {
  updateRunStepFieldValue(input: {
    id: 1462,
    value: true,
    etag: "066b1eb08dab44d6925d7bbd899e92cf"
  }) {
    runStepField {
      id value
    }
  }
}
```

This mutation does the following:

* Because it updates data, it's a `mutation`.
* The mutation is `updateRunStepFieldValue`.
* The field `id` is `1462` and the `value` you're setting is `true`.
* It includes the `etag` of the original field. The `etag` prevents accidental data overwrites by enforcing concurrency control.

The response returns the `id` and the updated `value` of the field.
