[RELEASE / FREE] JSON Serialize to URL query

This plugin create a serialized version of a JSON payload and will output a url encoded version (url parameters / query).

Use this when you need to dynamically create key/value pair for API that only accept url encoded data (like Stripe).

This is a server side action that contain two parameters
A) JSON Body that you wan’t to be url encoded
B) Traditionnal option. A Boolean indicating whether to perform a traditional “shallow” serialization.

Will ouput two results
A) Encoded (Example: a%5Bone%5D=1)
b) Decoded (Example: a[one]=1)

Example:

{"foo":[1,4,7,10],"bar":"baz","items":[{"id":"123","price":123.00},{"id":"345","price":345.00}]}

Will result in (decoded):

foo[]=1&foo[]=4&foo[]=7&foo[]=10&bar=baz&items[0][id]=123&items[0][price]=123&items[1][id]=345&items[1][price]=345
3 Likes

Nice! @Jici

1 Like

I really enjoyed using this plugin (it’s so easy to use! :clap:t2:) but later found that, as it’s a server side action, it can take 10 seconds to “warm up” and run for the first time if not executed within a 15 minute.

Are there any known workarounds for this? I’ve since moved it to running a custom JS script but would revert back in a heartbeat

1 Like

This is something you can ask Bubble support. In test mode (ehen we test plugin dev) this is something normal. But it shouldn’t be a problem in “prod”. This is a pretty simple script so it shouldn’t be that long to run. Maybe you can ask @thimo to create a client side version if this is something that can work for your case. This will run faster and cost 0 wu

1 Like

I assumed it would be an issue in prod env as well so that’s really good to know it isn’t. I created a javascript function to handle it and run that on the page but it would be cleaner as a plugin. Maybe I’ll try to build my own unless @Thimo can bust one out in a few minutes :laughing:

Don’t hesitate to fork it and convert it ;(

1 Like