Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

By calling 通过调用  http://api.fixer.io/latest?base=SGD, the following will be returned.,将返回以下内容。

 

Code Block
titleJSON 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.

Image Removed

在JSON中,大括号表示一个对象。方括号表示一个数组。

因为没有可以迭代的数组,所以这是配置它的唯一方法。这种情况下只会创建一条记录。

Image Added

如果您的JSON网址返回以下内容,If your JSON URL returns the following,

Code Block
titleJSON 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.

Image Removed

然后你可以配置如下,并使用“Multirow Data的基本JSON对象名称”,在那里它将遍历数组并创建多个记录。

Image Added
不幸的是,这不是JSON如何返回数据(不可扩展)。你必须适应它,因为你不可能要求他们改变数据的返回方式。如果添加了新信息,那么您将需要重新配置JSON插件以添加到另一行。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.