Back to forum list… Back to How Do I?...

Clever trick with JSON data required (2 replies)

Steve Bagnall
6 years ago
Steve Bagnall 6 years ago

Hi.  I wonder if anyone can suggest a time saving for getting some JSON currency rate data into shape.  It comes as follows.

{
  "timestamp": 1602633598,
  "base": "GBP",
  "rates": {
    "AED": 4.750917,
    "AFN": 99.515864,
    "ALL": 136.156621,
    "AMD": 622.922426,
    "ANG": 2.321936,
    "AOA": 833.117737,
    "ARS": 100.051862,

As far as I can see the currencies are individual fields under the "rates" transaction, with each having a value.  Therefore, to get rates for 200 currencies would mean defining each currency as a field name and ending up with one record for all rates.

The desirable outcome is to have the currency and rate as two fields under the rates transaction.  That way we would have one record per currency and rate.  Is that easily possible?

Support
6 years ago
Support 6 years ago

Unfortunately, there's no 'trick', you have to do it the hard way.

And whilst it looks as if each rate should map to a record....each rate is actually a field...not an object. An equivalent scenario is a row from a SQL query transforming the columns to individual rows.

Steve Bagnall
6 years ago
Steve Bagnall 6 years ago

Darn.  Thanks for the input.  I'll have to effectively convert each column to a row as you suggest.  Horrible! 

Contact

    Realisable Software Ltd provides code-free, cost-effective applications integration solutions for SMEs. Our core IMan product is designed to integrate almost any application with a number of Sage solutions and online payment processors.

    Looking to purchase IMan, please see our resellers here.

    Realisable Software
    Ph: +44 (0) 208 123 1017

    Copyright © Realisable. All rights reserved.
    Realisable is a registered trademark

    Close

    Request Demo

      Realisable Software Ltd provides code-free, cost-effective applications integration solutions for SMEs. Our core IMan product is designed to integrate almost any application with a number of Sage solutions and online payment processors.

      Looking to purchase IMan, please see our resellers here.

      Realisable Software
      Ph: +44 (0) 208 123 1017

      Copyright © Realisable. All rights reserved.
      Realisable is a registered trademark

      Close

      Access Downloads

        Realisable Software Ltd provides code-free, cost-effective applications integration solutions for SMEs. Our core IMan product is designed to integrate almost any application with a number of Sage solutions and online payment processors.

        Looking to purchase IMan, please see our resellers here.

        Realisable Software
        Ph: +44 (0) 208 123 1017

        Copyright © Realisable. All rights reserved.
        Realisable is a registered trademark

        Close