[Platform SDK] - model.Meta not defined
Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
Jean-Balteryx
16 - Nebula
08-29-2022
12:51 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
2 REPLIES 2
08-30-2022
06:34 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
@IraWatt, did you encounter this error ? Maybe solved it ?
mkhtran
9 - Comet
09-18-2023
03:32 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
The `model.Meta` value is typed as "FieldListArray | Array<any>", but I've found it to possibly be `undefined` at certain points of the tool's lifecycle as well. There doesn't seem to be any good documentation on how exactly this value behaves, so I've been treating it as `any`. For example
// If `model.Meta.fields` exists, then it's probably save to treat it as a `FieldListArray`
// Just make sure to safely check that `model.Meta` and `model.Meta.fields` aren't undefined
const inputFields: string[] = (model.Meta as any)?.fields?.[0][0].fields.map(field => field.name) ?? []