Brian Dunning's FileMaker Custom Functions

JSONToQueryParams ( json ; skipNullValues )

Convert json data to a query parameter-style format where each key and each value are url-encoded

  Be the first to rate this function Log in to vote

Mislav Kos   Mislav Kos - Show more from this author
Soliant Consulting
https://www.soliantconsulting.com/

Share on Facebook Share on Twitter

  Sample input:
{"abc":"hello world","foo":"bar"}
  Sample output:
abc=hello%20world&foo=bar

  Function definition: (Copy & paste into FileMaker's Edit Custom Function window)

Convert json data to a query parameter-style format where each key and each value are url-encoded.

For example: {"abc":"hello world","foo":"bar"} => abc=hello%20world&foo=bar

An example of where this is useful is when generating a pre-signed S3 url for uploading a file. If you want to include tags when the S3 object is created, you'll need to specify a Tagging property whose value needs to use a query parameter-style format.

In FileMaker, it's simpler to construct a json object, but S3 tagging requires tags to be specified in a query param-style format.

 

Comments

Log in to post comments.

 

Note: these functions are not guaranteed or supported by BrianDunning.com. Please contact the individual developer with any questions or problems.

Support this website.

This library has been a free commmunity resource for FileMaker users and developers for 20 years. It receives no funding and has no advertisements. If it has helped you out, I'd really appreciate it if you could contribute whatever you think it's worth: