Server Side .get() call to nested Custom Data type returns null

I have a list of custom data types (Our name: Item Map) and each refers to several other custom data types (Our names: Custom Property, Custom Property Item). I am trying to build some custom JSON to send to an external service for which I am using a Server Side action in a plugin.

I have follow the steps below:

  1. Pass the list to the plugin
  2. Call properties.ItemMapList.get(0,ItemMapList.length());

All seems to be good. I can call listProperties on one of the Item Maps and get a list of properties that looks something like:
_id
custom_property_custom_custom_property
custom_property_item_custom_custom_item_property

Then, I can call ItemMapList[0].get(“custom_property_custom_custom_property”).listProperties();

and get a response something like
_id
name_text

However, then I call ItemMapList[0].get(“custom_property_custom_custom_property”).get(“name_text”);

the result is null.

Am I doing something wrong? The same type of thing works on the client side, but for my application, it would be wayyy more complex to do this on the client side and I would risk the chance that it might not finish if the user closes the window before it finishes.

Thanks in advance for your help!

The code looks correct. Are you sure you are passing in a list that is not empty and everything correctly? Here is something I do that is similar and it is currently working:

let mapAreas = properties.map_areas.get(0, properties.map_areas.length())
    instance.data.mapAreas = mapAreas.map(area => {
    let newArea = {
        "coordinates": area.get(properties.coordinates),
        "center_point": area.get(properties.center_point),
        "assigned_users": [],
        "_id": area.get("_id"),
        "areaObject": area.get(properties.lead_data).get("_id")
    }
    return newArea
})

Here the “Map Areas” is a data type and the properties.lead_data is a data type. See I am able to say:

area.get(properties.lead_data).get("_id")

It seems like yours is set up identically except you are not getting id but name. Maybe try getting ID and see what that says?

Thanks for the quick reply! I should have noted theat get("_id") does return the id, every other field is null though. When I use the map reduce that is discussed in this post (How to access a nested list of objects in the plugin code without making an external API call? - #11 by keith), i get something like the following
“custom_property_custom_custom_property”:
{
“career_center_custom_career_centers”: null,
“description_text”: null,
“field_type_option_custom_property_field_type”: null,
“name_text”: null,
“type_option_custom_property_type”: null,
“Created By”: null,
“Slug”: null,
“Created Date”: null,
“Modified Date”: null,
“_id”: “1677878851912x385412217449218050”
},
I would have expected all the other fields to have data.

-Dave

Any privacy rules that apply?

Privacy rules

1 Like

Thanks all for the update. My colleague set up the privacy rules so I am admittedly not deep on them. However, this plugin server side action is run by a database trigger and my understanding is that it should run with full administrative privileges. Is that incorrect? If so, is there a guide on setting up privacy rules to allow a plugin to run how I need it to?

I’m experiencing this too. I’m confident it’s not an issue with privacy rules because the parent and child have the same privacy rules and the parent thing returns data. Did you find a solution?

Not unless you’re using your admin api key and making request to your endpoints.

No solution… I submitted a bug to bubble but haven’t heard back. Might be good if we all submit bugs.

Any update on this? I am facing the same issue. All nulls.

I haven’t gotten a response to my bug submission.