[NEW PLUGIN] Generate deep nested JSON from thing(s)

Hi @jon2,

I finally figured out your plugin,. So now that I understand what’s going on, I see it’s doing something I don’t know how to get around. You mentioned here ([NEW PLUGIN] Generate deep nested JSON from thing(s) - #22 by jon2): that “I’m going to assume that unless this is an issue where you’ve got looping db relationships in your DB (bad).” Well fortunately I learned something new from reading that, but unfortunately even after removing the back-loop as in:

Something
Something’s Things
Something

the plugin is still picking up the original structure. The JSON generated is showing the data that I need under the object(?) it loops back to instead of outside of it. (I hope all that makes sense.)

I also noticed that it uses the original field names for the fields that I’ve renamed over the course of time. That was confusing when I started playing with this.

Do you know of a way to stop it from pulling the original structure? So far this is the only plugin I’ve found that even gets me close to what I need.

Thanks for your help,
George

@SJL @jon2 were you able to figure out a workaround for this issue? seems like it always group by or show only unique elements of the nested data types

Hi
i’m trying to get an JSON for 2 columns of my database of 1000 rows, but I get error - “Plugin action inputs too large, should be less than 6 MB”
it works for 100 rows, but more gets stuck…
i don’t understand where it get 6 MB. for 100 rows it bring 8kb only…

This error is generated by bubble afaik. Have you validated the length of your text in some other way prior to sending to the plug-in?
My text:number of characters. Seems like maybe there is one or more long string(s) in your json. Maybe base64 encoded data like images?

I have two columns with geographic coordinates - Latitude and Longitude - im trying to extract. And another rows im nulling…
May it trying to convert all rows with images and long texts before cleaning them

Hi @jon2
Sorry for the super slow reply and thanks for getting back to me. I guess I missed your response. I’m coming back to this now.

I have tried adding in a 0 value but it doesn’t solve the problem. I just tried flipping between a 1 and a 0 in my field I’m trying to populate and it works when it’s a 1 but not when it’s a 0.

Any other thoughts would be greatly appreciated.
Thanks

Hi @jon2
Just wanted to check if there is an option to add a thousand separator when using the “USD” option to convert a value to currency?
i.e. Instead of $1234.00 it will be $1,234.00.

Unfortunately, this seems to be an issue with the get_object_from_id() javascript method which this plugin uses to get JSON data from your thing in the database. Bubble isn’t returning a value for 0 and there isn’t anything that can be done about it. :frowning:

One ugly workaround would be to try and store the value as a text or keep a mirrored text data type just for JSONest that matches your number. JSONest will interpret it as a text however and encapsulate the number in quotation marks "my_value" : "0" vs the correct "my_value" : 0.

Sorry I don’t have better news on this. I’ve discovered over the years that theget_object_from_id()method that JSONest is built on has a lot of unfortunate quirks.

  • Provides ugly field names that don’t match the field names in the editor.
  • Renaming fields in the editor doesn’t change the field names – they stick to their initial value.
  • Unpredictable amount of time to look up a thing in the db as well as random timeouts
  • Doesn’t return field names when the value is null or 0
  • Bubble engineers don’t support / haven’t even heard of this method – not officially supported.

I discovered the method when researching the very-popular toolbox plugin. I have no idea how the creator @mishav even discovered this unless he has a contact inside bubble.

If you don’t need nesting capabilities, the bubble Data API should return JSON of a thing with null or 0 values. This has the added benefit of returning the exact ‘pretty name’ for each field rather than the static and somewhat cryptic names that JSONest and get_object_from_id() returns. I’ve considered incorporating the data api into JSONest, but given the complexity / latency of programmatically calling the API from within a plugin (and the 10 second max execution time) I don’t think this would be feasible.

It is unlikely I’ll make any formatting additions to the upcoming versions of JSONest. There are just too many edge cases for this and various currency possibilities. I built some basic types to suit the project I built JSONest for, but thats about it unfortunately. The best option is to store your formatted currency number as a separate text inside your thing and retrieve that using JSONest. Not ideal, I know.

Sorry for the late reply. Thanks so much for your detailed answer. I really appreciate it. I will use your work around.

@jon2

First of: awesome plugin - thank you for creating and sharing it. Its a huge help.

Now, I’m not sure if this is the best place to report this, but it seems there is a regression in the update from 1.3.0 to 1.3.1.

On 1.3.1 I constantly had the issue that one data type was never rendered into the JSON file (even when all Privacy rules removed). All other data types worked fine though. I’m not sure what is special about this data type. I was really banging my head against the wall. Only after downgrading to 1.3.0 immediately resolved that issue for me.

Feel free to shoot me a message and I share more details about the data type.

Thanks again for this great plugin!

This was already possible natively with Bubble with format as text.

Not when this plugin was built. Also, that’s a lot of carpal tunnel inducing nonsense to build an expression that deeply parses a complex Thing.

It’s really not tho. To me atleast.

I’m using this to send things that contain multiple lists of other things (and the information within those) to an REST API. Didn’t find any other way to do this.

@Sascha you’d use format as text. but if this plugin simplifies it for you i’d keep using it

I’m getting an issue where this plugin seems to be returning old data, It only occurs with this plugin. Anyone know why this might be?

@jon2

I’m not able to figure out how to set configuration

I need all records from my data type Event Sessions to create array.
Can you please guide me through this?

Hello, i have a strange bug here …

I currently always get an empty body back and i really dont know how to configure the plugin properly … can someone help me here?

i have named the datafields like my fields in my database because thats what ive seen earlier here on the forum, but i have had no luck

If i leave it blank its not valid anymore

can someone advise? i am not a professional :smiley:

Thanks in advance