AnsweredAssumed Answered

JSON profile: Handling repeating array element that changes from simple type to object

Question asked by RobertdeCarvalho5171 on Oct 16, 2017
Latest reply on Dec 20, 2017 by RobertdeCarvalho5171

Hi Boomi-land,

 

We have a slighltly uncoorporative source system. We should be getting an a JSON message with one component being a repreating array of "meta_data" that is made up of elements defined like this this:

 

AttributeTypeDescription
idintegerMeta ID.READ-ONLY
keystringMeta key.
valuestringMeta value.

Which we put into the JSON profile as this:

 

But in practice the source system is not returning all "value" data is a simple value. Here's an example:

 

"meta_data": [
            {
                "id": 1000000,
                "key": "account_id",
                "value": "123456789"
            },
            {
                "id": 1000001,
                "key": "_token_cards",
                "value": {
                    "1234567890": {
                        "id": 1234567890,
                        "number": "42XXXXXXXXXX7420",
                        "exp_month": 3,
                        "exp_year": 22
                    },
                    "9876543210": {
                        "id": 9876543210,
                        "number": "44XXXXXXXXXX1111",
                        "exp_month": 4,
                        "exp_year": 19
                    }
                }
            }

]

 

The "_token_cards" result is the problem. We get this error:

 

[Input ProfileLocation: Root/Array/ArrayElement1/Object/meta_data/Array/ArrayElement1/Object/value; DocumentLocation: /Root/Array/ArrayElement1[1]/Object/meta_data/Array/ArrayElement1[5]/Object/value]: Expected simple value, found START_OBJECT

 

We don't actually need the "_token_cards" data for the particular integration we are working on and not all customer records have it. There is also a different number of meta fields depending on info we have stored for each custimer, and they don't always come out in the same order. So we need a way to either map the troublesome element, or get rid of it. Is there a way we can handle this?

 

Thanks,
Rob

 

Note: the meta "id" field is just a sequence number for the table of meta values. It is different for every customer and we don't use it in integration.

Outcomes