Does rudderstack support JSON objects and arrays o...
# support
t
Does rudderstack support JSON objects and arrays of json objects as properties? Assuming yes, is there ways to transform this for destinations that do not support them? For example, imagine these property structure:
Copy code
{
  'foo': 1,
  'bar': {
    'x': 'a',
    'y': 'b'
  }
}
If a destination needed the properties to be send to it being flatted like this, can rudderstack do this?
Copy code
{
  'foo': 1,
  'bar x': 'a',
  'bar y': 'b'
}
m
Hey There! 👋 Your message has been received by the RudderStack team. Our standard customer support hours are 9-6 PM EST, but we will forward this request to your Technical Account Manager, and they will get back to you shortly. Please use the thread for any additional comments.
q
You can write user transformations to update the payload before sending it to the destination. Here is the documentation https://www.rudderstack.com/docs/features/transformations/
t
@quiet-wolf-72320 Sorry I know about transformations. What I’m asking is whether I’m the initial ingestion into rudderstack, will it accept nested properties? I’m surprised how many analytics and data systems fail with this.
q
The initial ingestion has a pre-defined structure with some required fields that should be followed. https://www.rudderstack.com/docs/api/http-api/. You can add custom fields but can’t change the structure.
t
@quiet-wolf-72320 sorry for basic questions but I'm still confused. looking at `track()`: https://www.rudderstack.com/docs/api/http-api/#track I believe I'm asking about the
properties
attribute, which is used to send in custom properties. Can those properties be nested? e.g.
Copy code
{
  "userId": "identified user id",
  "anonymousId":"anon-id-new",
  "event": "Product Purchased new",
  "properties": {
    "product": {
         "name": "Red Shirt",
         "price": 19.99,  
    },
    "Foo": "Bar",
  },
  "context": {
    "ip": "14.5.67.21",
    "library": {
        "name": "http"
    }
  },
  "timestamp": "2020-02-02T00:23:09.544Z"
}
p
Hi @thankful-gpu-70135, just tested it this and it looks like that should be possible
Screenshot 2023-06-19 at 12.21.48 PM.png
👍 2