Dynamic schemas in custom formulas

Hi lovely people :slight_smile:

For hours I’ve been rummaging through the SDK docs, sample packs code, and even PAGE TWO OF GOOGLE SEARCH RESULTS :scream: trying to find an answer, but without any luck.

Does anyone know… is it even possible to implement dynamic schemas in custom formulas and column formats?

I’m working with a really flexible data model where users are able to customize the properties of entities within their account, adding new properties without much limitation. This makes for a great system, but a tricky schema to work with.

I’ve got dynamic schemas working great with dynamic sync tables, but I’m not having the same luck with custom formulas and columns.

A workaround I’ve implemented in the interim is to set includeUnknownProperties to true. This displays whatever properties I add to the object, even if those properties aren’t defined in the schema. But, as documented, these properties can’t be used in formulas, so my Pack users will be limited to viewing these, but not being able to work with their dara.

Perhaps I missed something. Can someone point me in the right direction???

1 Like

Hi @Jono_Bouwmeester1 - I don’t think it’s something we’ve documented yet, so not your fault that you couldn’t find the answer. Unfortunately formulas can’t return dynamic schemas today, only static ones. Using includeUnknownProperties has downsides as you mentioned.

I think a decent workaround may be to return dynamic fields as JSON, and have users use the ParseJSON formula to retrieve individual fields. You could alternatively return an array of key/value pairs but I’m not sure how much easier that is to work with in CFL.

5 Likes

To close the loop: I’ve added an entry to the FAQ that addresses this question: