# Cannot convert undefined or null to object with (assuming) invalid sync table getschema

**URL:** <https://connect.superhuman.com/t/cannot-convert-undefined-or-null-to-object-with-assuming-invalid-sync-table-getschema/34800>\
**Category:** Making Packs\
**Created:** [October 25, 2022, 8:22am UTC](https://connect.superhuman.com/t/cannot-convert-undefined-or-null-to-object-with-assuming-invalid-sync-table-getschema/34800 "2022-10-25T08:22:05Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![louca.developer](https://yyz1.discourse-cdn.com/coda1/user_avatar/connect.superhuman.com/louca.developer/32/22685_2.png) [@louca.developer](https://connect.superhuman.com/u/louca.developer)\
**Post date:** [October 25, 2022, 8:22am UTC](https://connect.superhuman.com/t/cannot-convert-undefined-or-null-to-object-with-assuming-invalid-sync-table-getschema/34800/1 "2022-10-25T08:22:05Z")

</div>

I am getting this error when returning a schema from my `dynamicOptions.getSchema`. I have confirmed that nothing in my schema is null or undefined. I am looking to get assistance into why the schema is being rejected, and also raising the issue for undescriptive error message (likely due to some internal bug).

Error:

```auto
Request type getSyncTableSchemaMetadataRequest
Error Cannot convert undefined or null to object
Stack trace at processTicksAndRejections (node:internal/process/task_queues:96:5) 

```

Schema that breaks it is like:

```auto
{
  "includeUnknownProperties": false,
  "properties": {
    "Date": {
      "type": "string",
      "codaType": "date"
    },
    "Name": {
      "type": "string"
    },
    "People": {
      "type": "array",
      "items": {
        "type": "object",
        "codaType": "person"
      }
    }
  },
  "idProperty": "rowURL",
  "displayProperty": "rowURL",
  "featuredProperties": [
    "Date",
    "Name",
    "People"
  ],
  "type": "object"
}

```

---

<div class="post-metadata">

**Author:** ![Eric\_Koleda](https://yyz1.discourse-cdn.com/coda1/user_avatar/connect.superhuman.com/eric_koleda/32/50286_2.png) [@Eric\_Koleda](https://connect.superhuman.com/u/Eric_Koleda)\
**Post date:** [October 25, 2022, 5:41pm UTC](https://connect.superhuman.com/t/cannot-convert-undefined-or-null-to-object-with-assuming-invalid-sync-table-getschema/34800/2 "2022-10-25T17:41:52Z")

</div>

Hi @louca.developer - I’m having trouble reproducing the issue exactly, but a few things jump out:

- The `rowURL` property isn’t defined, but is referenced as the display and ID property.
- The Person schema in the `People` property is incomplete. It needs to define an ID property that contains the email address of the user. [Read more](https://coda.io/packs/build/latest/guides/basics/data-types/#people).

---

<div class="post-metadata">

**Author:** ![louca.developer](https://yyz1.discourse-cdn.com/coda1/user_avatar/connect.superhuman.com/louca.developer/32/22685_2.png) [@louca.developer](https://connect.superhuman.com/u/louca.developer)\
**Post date:** [October 27, 2022, 4:11am UTC](https://connect.superhuman.com/t/cannot-convert-undefined-or-null-to-object-with-assuming-invalid-sync-table-getschema/34800/3 "2022-10-27T04:11:29Z")

</div>

Thanks, helped me figure out the issue.

> The `rowURL` property isn’t defined, but is referenced as the display and ID property.

I made a mistake when simplifying the object for pasting here but this prop was present.

> The Person schema in the `People` property is incomplete. It needs to define an ID property that contains the email address of the user. [Read more](https://coda.io/packs/build/latest/guides/basics/data-types/#people).

This was indeed the cause. I would propose that its worth looking into changing the validation code to not error out on such bad schemas.

---

<div class="post-metadata">

**Author:** ![Eric\_Koleda](https://yyz1.discourse-cdn.com/coda1/user_avatar/connect.superhuman.com/eric_koleda/32/50286_2.png) [@Eric\_Koleda](https://connect.superhuman.com/u/Eric_Koleda)\
**Post date:** [November 10, 2022, 5:20pm UTC](https://connect.superhuman.com/t/cannot-convert-undefined-or-null-to-object-with-assuming-invalid-sync-table-getschema/34800/4 "2022-11-10T17:20:25Z")

</div>

I’m glad you were able to find the issue. I’m still having trouble trying to reproduce your error though, as I keep getting this more informative one instead:

> Objects with codaType “person” require a “idProperty” property in the schema definition.

If you have the time, could you send along a complete snippet of code that leads to the original error?
