Custom Component - get field's picklist entries in builder?

I’m building a custom component, and would like to have a picklist property in the builder that contains the picklist entries for a predefined field.

What’s the best way to access a specific field’s metadata in the builder? Do I have to create a dynamic model builder-side just to access that?

Hey Matt -

Haven’t checked to see if this would work but it should.  There might even be a better way but hopefully this gets you what you need.

From your builder.js, you can get a model using the following:


From there, you should be able to navigate the fields, etc. to get the picklist values.

Matt -

Sorry for the false hope but the above actually won’t work as it returns the model xmlDefinition, not the actual model.

You can obtain the “field” for the model using the following:

skuid.builder.getFieldInfoFromCache(‘MyModel’, ‘MyField’)

Unfortunately, that won’t get you what you need :frowning:  It appears that under the covers, Skuid is not retrieving picklist entries for model metadata within the builder.  Makes sense, since there isn’t anywhere that I can think of where they would need that level of information so for performance reasons, it just doesn’t request them.

There are some other APIs that could get you the information but in the end, you’ll end up having to make a remote call anyway so to simplify, I think you’re original idea of just creating a model and querying will be the easiest approach.

Thanks, Barry. Off to create a builder-side dynamic model! :slight_smile: