Expand my Community achievements bar.

Join expert-led sessions on Real-Time CDP & Journey Optimizer designed to boost your impact.
SOLVED

update an object array in a profile table is creating new object instead of updating new one

Avatar

Level 1
Hi Community, I have an array object in my profile type table. I want to add new key person_type in array object. When I added a new key and value and insert data into it. it created a new separate new array object in unified profile. In my unified profile I have two array object, one with old fields other with new fields. Can i ingest into same old array object and not have new array created. OLD OBJECT "personal_details": [ { "fistname":"smith", "lastname":"jose", "county" : "USA" },{ "fistname":"steve", "lastname":"anthony", "county" : "France" } ] New OBJECT "personal_details": [ { "fistname":"smith", "lastname":"jose", "county" : "USA", "person_type":"S" },{ "fistname":"steve", "lastname":"anthony", "county" : "France", "person_type":"Y" } ] Thanks in Advance Best Regards,
1 Accepted Solution

Avatar

Correct answer by
Employee

I've not seen good results combining upsert with arrays.

 

Nobody likes refactoring, but I'd split that array off into another schema/dataset where you don't need to use upsert. And then send the entire array every time that there's any change. Just ignore the array field in the original schema/dataset going forward.

View solution in original post

2 Replies

Avatar

Level 1

Also I have enabled upsert in my dataset

Avatar

Correct answer by
Employee

I've not seen good results combining upsert with arrays.

 

Nobody likes refactoring, but I'd split that array off into another schema/dataset where you don't need to use upsert. And then send the entire array every time that there's any change. Just ignore the array field in the original schema/dataset going forward.