Adding element to a json object in ADF

Kothai Ramanathan 946 Reputation points Microsoft Employee
2020-12-10T09:15:00.803+00:00

I have a pipeline which has an object as a parameter. This object contains a json. Want to know if there are any ADF inbuilt function through which I can add another element to this json.

Initial json :
{
'fistname":"abc"
{
New json :
{
'fistname":"abc",
"lastname":"xyz"
}

Is there any add/addElement() function which can add another element to the existing json.

Thanks,
Kothai.

Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
11,624 questions
{count} votes

Accepted answer
  1. HarithaMaddi-MSFT 10,146 Reputation points
    2020-12-11T09:07:22.167+00:00

    Hi @Kothai Ramanathan ,

    Welcome to Microsoft Q&A Platform. Thanks for posting the query.

    There is no function to add element to JSON string in ADF and this can be achieved by using Azure Functions or indirectly using ADF with array variables which supports append operation. JSON can be converted to Array and then element can be appended to it which later can be converted to string and JSON while loading. Below are snaps related to it.

    47159-image.png

    47327-image.png

    47401-image.png

    Please let us know for further queries and we will be glad to assist.

    ---

    • Please accept an answer if correct. Original posters help the community find answers faster by identifying the correct answer. Here is how.
    • Want a reminder to come back and check responses? Here is how to subscribe to a notification.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.