.Json sink has column name and \ in the file

VishalV 6 Reputation points
2022-09-27T21:04:10.53+00:00

hello
I am using a dataflow activity in ADF to search and replace value - .json data as per this suggestion https://learn.microsoft.com/en-us/answers/questions/779149/data-flow-search-and-replace-value-json-data.html
245209-image.png
I was able to replace the string but in my .json sink, i have the column name and \ .
245273-image.png

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

1 answer

Sort by: Most helpful
  1. AnnuKumari-MSFT 34,551 Reputation points Microsoft Employee Moderator
    2022-09-29T07:33:49.51+00:00

    Hi @VishalV ,
    Welcome to Microsoft Q&A platform and thanks for posting your question here.
    As per my understanding , you want to replace one string with another using data transformation in mapping Dataflow . Please let me know if my understanding is incorrect.

    You can try the following approach :

    1. Upload the .json file into ADLS and create a dataset with .json format and use the same in source transformation. Make sure to select Array of documents option in JSON settings of Source options tab.
    2. Use Flatten transformation to convert items of array into individual rows. Select schools[] array in unroll by option and select the input columns
    3. Use derived column transformation to replace one string with another for all the relevant columns.
    4. Add surrogate key column to add a dummy incremental column
    5. Use Aggregate transformation to again group the columns into array by using collect function and grouping using identity column.
    6. Use select transformation to remove the unwanted identity column
    7. Use sink transformation to load the data again into .json file. In the sink setting, Select 'Output to single file' in FileName Option and set Single partition when pop up arrives. Provide outputFileName and run the pipeline.

    Please refer to the following video:

    245991-dataflow2.gif

    Hope this will help. Please let us know if any further queries.

    ------------------------------

    • Please don't forget to click on 130616-image.png or upvote 130671-image.png button whenever the information provided helps you.
      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
    • If you are interested in joining the VM program and help shape the future of Q&A: Here is how you can be part of Q&A Volunteer Moderators
    0 comments No comments

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.