Switch JSON Values Tutorial

Switch JSON Values Tutorial

Have you ever struggled to find one tiny piece of information in a bunch of data? Well, when handling large data sets, this can happen very often and delay several processes. Therefore, we've developed a feature that our users might find helpful. The Advanced Switch API lets users transform and retrieve specific data points from JSON data sources. In this blog, we'll explain how this endpoint works and how you can set it up.

Not a fan of reading? No problem! Check out our quick, easy-to-follow video tutorial to learn everything you need and set it up quickly!

Setting up the Get JSON values from keys endpoint

First, we'll need to log in or sign up for Make and create a scenario. Then, we have to click on the empty module and select 0CodeKit. We'll get an overview of all features available in Make, but we have to search for the "Switch the Keys and Values" endpoint and click on it. It'll automatically request to create a connection between Make and 0CodeKit, and you can easily do this by entering your 0CodeKit API key.

Later, we'll need to feed the Advanced Switch a dataset and the key value that we want to retrieve. However, there are two ways to input a dataset into this module. The first choice is an Internal JSON, which is just entering a JSON string.

On the other hand, we can also choose an External JSON. Here, the input would be a URL that contains a data set in the form of a JSON string. Here you can find the JSON sample used: https://raw.githubusercontent.com/gewinnorientiert/json-sample/refs/heads/main/sample.json

Finally, we have to enter the value that we want to retrieve into the Key field, which in this case is "AF". Once the module is fully set up, we have to click on "OK" and execute it. The Advanced Switch will process the request and return the result "Afghanistan", based on the information in the data set.