[New Free Plugin] Json Generator

Hello,

We just published a plugin ‘Json Generator’ as the bubble community may find it useful (especially those working with api stuff).

You can provide the fields in a workflow step ‘Set to’ of a ‘Json’ element on the page. The plugin will automatically generate a JSON string that you can use in your app as the ‘Json element’s output’.

How to use:

  1. Install the plugin
  2. Place the Json element on the page (you can place as many as u need).
  3. Run the workflow step ‘Set to’ and reference the element.
  4. This will update the ‘output’ Json of that element for your use
  5. That’s it!

Happy Bubbling!

Cheers,
The AirDev team

19 Likes

Here’s the example screenshot for reference

2 Likes

Thanks for publishing this @gaurav! Will be useful for me and lots of other people in the community, I’m sure.

1 Like

:smile:

goodbye painful changes…
image

3 Likes

Lol :smiley:

Just added ability to nest other JSON outputs. Now you can build nested JSON objects :smiley:

4 Likes

Downloaded the plugin. Thank you.

I added it to a test page to understand how it works. Easy to set up.

My questions is, what are some scenarios that we can use this plugin on our sites?

Scott

1 Like

Speaking for us, we have a number of places in app where we’re writing JSON to send to other services.
For example, @copilot’s sendgrid plugin custom args, events sent to tools like segment or astronomer need to be json, there are many more.

Prior to this plugin, we’ve had to manually type the JSON block carefully into one field like I’ve shown above. It’s a serious pain to write and maintain – it’s easy to drop a " or , and the code breaks; bad things ensue.

Here’s an example for how to use it: 1) create the JSON 2) now you can reference the JSON in other actions.

4 Likes

To convert things to JSON you can also use JSON tools.

1 Like

Does the plug-in support creating arrays from lists, by any chance? That’d be huge for me.

2 Likes

Can you elaborate with an example?

Sure. I’d like to create scatter plots in my app, based on user data. I think plot.ly will be my best option. I’ve sorted out authentication and I can embed plots in my app using data that I enter in plot.ly itself.

Now I’m trying to figure out how to PUT a JSON object—which in my case is a table of text strings and numbers.

The format of the JSON object for plot.ly will be data structured into columns. So, I will have columns of text strings and columns of numbers to send, and the way to do that is to use JSON arrays.

How might I use your plug-in to do that?

Or any other suggestions?

Is there a way to capture an array of data from referenced things in this plugin in? I am looking for an output like this…

{
“Thing A Field 1” : “Thing A Field 1 Value”,
“Thing A Field 2” : “Thing A Field 2 Value”,
“Thing A Field 3 (List of Thing Bs)”:[{“Thing B1 Field 1”:“Thing B1 Field 1 Value”, “Thing B1 Field 2”:“Thing B1 Field 2 Value”,“Thing B1 Field 3 (List of Thing Cs)”:[{…}]}, {“Thing B2 Field 1”:“Thing B2 Field 1 Value”, “Thing B2 Field 2”:“Thing B2 Field 2 Value”,“Thing B2 Field 3 (List of Thing Cs)”:[{…}]}]
}

The generator allows you to provide other Json ojects as input so you can generate nested Jsons. Regarding arrays, either:
1: Env variable plugin: you can write simple code to construct ur json and output it to an env variable.
2. There’s something I’m planning to publish soon which should likely make this extremely easy. So you could wait for it (maybe a week or so)

1 Like

thank you @gaurav I will loo at this. This could work. And yes, i would be very interested in having a JSON plug in that could easily compile all data and referenced data of a thing and generate a JSON. I cannot imagine I am the first person trying to do this. Thanks!!

1 Like

Ofcourse. Although I think this would just be a small use case of the plugin among many other things :smiley:

You are correct. You are not the only one interested in such additional functionality in this plugin. I am patiently awaiting it as well :slight_smile:

Thanks for making this plugin! Can now easily send emails :smiley:

One question: will it be possible to use this is a API Workflow? Or is this on the planning?

Cheers!

This should do the job :smiley:

Thanks, but how?