Quantcast
Channel: Pentaho Community Forums
Viewing all articles
Browse latest Browse all 16689

JSON input: Reading JSON array

$
0
0
If, for example, I have a JSON array of a customer's address as follows:
Code:

{ "Accounts": {
  "Customer": [
  ...
  ]
  "Address": [
                    {
                        "Address_AddressPointer":1,
                        "Address_Line1":"123 Some Street",
                        "Address_Line2":"",
                        "Address_Line3":"",
                        "Address_Line4":"",
                        "Address_Line5":"",
                        "Address_Country":"",
                        "Address_PostCode":"SN2 8JW",
                        "Address_PrimaryFlag":"YES",
                        "Address_Superseded":"NO"
                    }
.....

... the path will be mapped as
..$Address[0].Address_AddressPointer
..$Address[0].Address_Line1
..$Address[0].Address_Line2
..$Address[0].Address_Country
..$Address[0].Address_PostCode
..$Address[0].Address_PrimaryFlag.


How does PDI handle if this customer has a multiple addresses and we're only interested in getting the address where the PrimaryFlag = "YES".
What if there will be additional fields? Are we saying that for as long as the JSON fields are not mapped to their path, new fields will not be found in the PDI data streams?

Sorry, I haven't worked with JSON before. Can anyone help?

Viewing all articles
Browse latest Browse all 16689

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>