Hi @CORONADO GRANADOS Diana Milena ,
Thank you for your query. Unfortunately array accessor is not supported in schema mapping sink of copy activity, which is why you are seeing the error message.
If you have any flexibility with your sink JSON structure, you could try removing the array accessor [0]. For example if your csv input has data as below:
TypeOfAccomodation,StreetAddress,PostalCode,Type,PurchaseValue
nothing,something,08036,34,8999
Then have your mapping as below:
"mappings": [
{
"source": {
"name": "DDTypeOfAccomodation",
"type": "String"
},
"sink": {
"path": "$['InsuredItems']['Accomodation']['TypeOfAccomodation']"
}
},
{
"source": {
"name": "DDStreetAddress",
"type": "String"
},
"sink": {
"path": "$['InsuredItems']['Accomodation']['AccommodationAddress']['StreetAddress']"
}
},
{
"source": {
"name": "DDPostalCode",
"type": "String"
},
"sink": {
"path": "$['InsuredItems']['Accomodation']['AccommodationAddress']['PostalCode']"
}
},
{
"source": {
"name": "DDType",
"type": "String"
},
"sink": {
"path": "$['InsuredItems']['HouseholdAppliance']['Type']"
}
},
{
"source": {
"name": "DDPurchaseValue",
"type": "String"
},
"sink": {
"path": "$['InsuredItems']['HouseholdAppliance']['PurchaseValue']"
}
}
]
This will output as below JSON structure:
{
"InsuredItems": {
"Accomodation": {
"AccommodationAddress": {
"StreetAddress": "something",
"PostalCode": "08036"
},
"TypeOfAccomodation": "nothing"
},
"HouseholdAppliance": {
"Type": "34",
"PurchaseValue": "8999"
}
}
}
Let us know if the above solution helps. And also I would recommend you to please provide a feedback in ADF user voice forum for a feature request to support array accessor in schema mapping sink of Copy activity.
ADF user voice forum: https://feedback.azure.com/forums/270578-azure-data-factory
----------
Thank you