Skip to content

sectionId for a field that's not in a section is "add more" #170

@battis

Description

@battis

Scenario & Reproduction Steps

It took me a bit of debugging to figure this out: I was trying to figure out how to safely identify a field from a secret reference so that I could write an updated value to it. The edge case I was looking at was a field that a) shared the same title as another field, but also b) was not in a section.

Imagine my surprise to find out that, when iterating across the item's fields, the sectionId, as reported by 1password-sdk, was not undefined or an empty string but "add more".

Actual Behavior

Here's a concrete example. This is the item as seen in 1Password:

Image

I'm working with the last password field -- the one not in any section. It's secret reference is op://dev/yxmfyrltenwk7avd6wkcl6yase/password and when I try to identify that field, I'm looking at an item that is described by the SDK thus:

{
  "id": "yxmfyrltenwk7avd6wkcl6yase",
  "title": "examples/dev-1password-env",
  "category": "Login",
  "vaultId": "<hidden>",
  "fields": [
    {
      "id": "3smnt7pb7leszffrziscbv4fbe",
      "title": "write-test",
      "sectionId": "vxckujnmer6ohovfbdso4mkfzi",
      "fieldType": "Text",
      "value": "1766582962798",
      "details": null
    },
    {
      "id": "ca4yvqqsx7znj2dt626raxy34q",
      "title": "password-test",
      "sectionId": "vxckujnmer6ohovfbdso4mkfzi",
      "fieldType": "Concealed",
      "value": "dWxQnaiFJn4BmLbr3c_H",
      "details": null
    },
    {
      "id": "cz5xx4wliffxgv5b4ttovcjsmm",
      "title": "password",
      "sectionId": "33p7y6fv75r33whchnyruct3ua",
      "fieldType": "Concealed",
      "value": "tv8HwcziaJo9HDECxVpC",
      "details": null
    },
    {
      "id": "pbxexp54bxvyq4cxzilscjedzy",
      "title": "password",
      "sectionId": "33p7y6fv75r33whchnyruct3ua",
      "fieldType": "Concealed",
      "value": "WiCKqLkrZYqgLbK6H9tU",
      "details": null
    },
    {
      "id": "nqekfdcyya6uuw2m2bjkon5w6m",
      "title": "password",
      "sectionId": "add more",
      "fieldType": "Concealed",
      "value": "2025-12-24T02:41:51.044Z",
      "details": null
    }
  ],
  "sections": [
    {
      "id": "vxckujnmer6ohovfbdso4mkfzi",
      "title": "env"
    },
    {
      "id": "33p7y6fv75r33whchnyruct3ua",
      "title": "alt section"
    },
    {
      "id": "add more",
      "title": ""
    }
  ],
  "notes": "",
  "tags": [],
  "websites": [],
  "version": 38,
  "files": [],
  "document": null,
  "createdAt": "2025-07-14T20:06:30.000Z",
  "updatedAt": "2025-12-24T13:29:23.000Z"
}

Behold the mysterious final section with an empty string for a title and the id add more. So weird.

Expected Behavior

In my head, I was imaging that the field would have an undefined sectionId, inasmuch as it was not in a section or that there would be some sort of "default" section that section-less fields would go into that would have a real ID (which I guess is what add more is?).

SDK version

0.3.1

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions