Alteryx IO Discussions

Customize and extend the power of Alteryx with SDKs, APIs, custom tools, and more.

[Platform SDK] - model.Meta not defined

16 - Nebula
16 - Nebula

Hi everyone !


When using the Platform SDK and trying to access the model metadata, I get the following error in the Console :


Capture d’écran 2022-08-29 à 09.50.06.png


I updated @Alteryx/react-comms to 1.0.1 but it didn't solve the error.


Does anyone have an idea ?


Thank you for your help !

16 - Nebula
16 - Nebula

@IraWatt, did you encounter this error ? Maybe solved it ?

9 - Comet

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] => ?? []