Thanks for using MS Q&A platform and posting your query.
I understand that you're experiencing issues with extra lines appearing in your Azure Data Factory (ADF) expression output.
To remove the extra lines and expression syntax, you can use the
toString()function in ADF. This function will help you convert the expression output to a string, removing any unnecessary characters.
Here's an updated version of your expression:
toString(
@(
address = @(
countryCode = Country
),
contactPointType = '1',
lastUpdated = @(
updatedAt = '1900-01-01T00:00:00.000',
updatedBy = 'EPLOY'
),
sortOrder = 0
),
@(
additionalContactInfo = @(
eMail = Email,
eMailCc = iif(isNull(Email2) || Email2 == '', '', Email2)
),
address = @(
countryCode = Country,
place = Town,
postcode = PostCode,
province = County,
streetAddress = Address11
),
contactPointType = '9',
lastUpdated = @(
updatedAt = '1900-01-01T00:00:00.000',
updatedBy = 'EPLOY'
),
phoneNumbers = @(
telephone1 = Telephone11,
telephone4 = telephone41
),
sortOrder = 0
)
)
Expected Output
By using the toString() function, your output should now look like this:
[
{
"address": {
"countryCode": "GB"
},
"contactPointType": "1",
"lastUpdated": {
"updatedAt": "1900-01-01T00:00:00.000",
"updatedBy": "EPLOY"
},
"sortOrder": 0
},
{
"additionalContactInfo": {
"eMail": "******@eagles.com",
"eMailCc": ""
},
"address": {
"countryCode": "GB",
"place": "Sevenoaks",
"postcode": "TN132PZ",
"province": "Kent",
"streetAddress": "Novacare Complex"
},
"contactPointType": "9",
"lastUpdated": {
"updatedAt": "1900-01-01T00:00:00.000",
"updatedBy": "EPLOY"
},
"phoneNumbers": {
"telephone1": "+441732451530",
"telephone4": "+447123456789"
},
"sortOrder": 0
}
]
Hope this helps. Do let us know if you any further queries.