Access nested custom data types from plugin?

I’m dabbling with writing a plugin and am trying to figure out how much data gets passed in when using nested custom data types.

For example, if I have a custom data type called “Car”, and Car has a field called “Wheels” that is a list of custom data type objects of type “Wheel”, and Wheel data types have a field called “Bolts” that is a list of custom data type objects of type “Bolt”, how much of that gets passed to a plugin if I send in a “Car” object?

In the Bubble interface I can do a query that’s “The Car’s Wheel’s Bolt’s”. Is there a way to do the equivalent if I passed in a “Car” to a plugin or would I have get to the Bolts first and then pass those directly to the plugin? Are there any ways to do searches or lookups in a plugin if I have the unique_id of the objects? Thanks!

In short, yes this can be done.
See this post which is for Server Side but the same applies Client Side.

If you know which nested fields you want then you pass as a parameter in .get(field_name_here), or if you don’t know the field name then you can retrieve all fields nested within an object via .listProperties() and then sort through the resultant array.

2 Likes