You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Current »

By calling http://api.fixer.io/latest?base=SGD, the following will be returned.

 

JSON Data
{
    "base": "SGD",
    "date": "2015-12-21",
    "rates": {
        "AUD": 0.99092,
        "BGN": 1.2777,
        "BRL": 2.8235
    }
}

In JSON, Curly bracket denotes an object. Square bracket denotes an array.

Because there's no array that we can iterate through, therefore, this is the only way of configuring it. Only one record will be created for this case.

If your JSON URL returns the following,

JSON Data
{
    "base": "SGD",
    "date": "2015-12-21",
    "rates": [
        { "currency" : "AUD",
          "rate" : 0.99092
        },
        { "currency" : "BGN",
          "rate" : 1.2777
        },
        { "currency" : "BRL",
          "rate" : 2.8235
        }
    ]
}

Then you can configure as follow and make use of the "Base JSON Object Name for Multirow Data" where it will iterate through the array and create multiple records.

Unfortunately, this is not how the JSON is returning the data (not scalable). You must adapt to it since it is not possible for you to ask them to change how the data is returned. If there's a new currency added in, then you will need to re-configure the JSON plugin to add in another row for it.

 

  • No labels