![Steve_Schrader1 Steve_Schrader1](https://community.airtable.com/legacyfs/online/avatars/3X/7/c/7cf878b53d662ce3ab79db941c631109f3246b48.png)
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎Aug 08, 2022 08:45 AM
I am trying to create a field which links a table to itself:
//Now that the table has been created add the linked field
var newFamily = base.getTable( familyName );
var linkOptions = {
linkedTableId: newFamily.id,
prefersSingleRecordLink: true,
isReversed: false,
};
await newFamily.createFieldAsync( ‘SpouseLink’, ‘multipleRecordLinks’, linkOptions );
I am getting an error:
j: Can’t create field: invalid field config.
Failed schema validation: prefersSingleRecordLink is not included in the .options schema, isReversed is not included in the .options schema
I am confused because I have include those fields in the schema …
![kuovonne kuovonne](https://community.airtable.com/legacyfs/online/avatars/3X/b/c/bcecb2d58f8302e9d9f520621c02ff41be54488c.jpeg)
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎Aug 08, 2022 12:12 PM
Welcome to the Airtable community!
Sometimes the error messages and/or documentation are not up to date. Try taking out both isReversed
and prefersSingleRecordLink
from the options. The scripting documentation currently says to not include them when creating a field.
// Note: prefersSingleRecordLink cannot be specified via programmatic field creation
// and will be false for fields created within an app
}
![Steve_Schrader Steve_Schrader](https://community.airtable.com/legacyfs/online/avatars/3X/5/4/54aa175a2e04254a7a4b71ee578274832de7e6df.png)
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎Aug 08, 2022 01:21 PM
That worked. Serves me right for looking and beleiving the error message which clearly states it is needed!
Sheesh
![](/skins/images/DD0CD7D0ACF200EF4456420D87029A3D/responsive_peak/images/icon_anonymous_message.png)