ADF - how to remove the square bracket from json as a source.

Anurag Yadav 1 Reputation point
2022-09-23T10:24:03.03+00:00

My source is json file and target is API. This extra square bracket is failing to post in the target API. Anything to be done in mapping which I am missing ? I have created items collection using dataflow.
244159-whatsapp-image-2022-09-23-at-10944-pm.jpeg

Please help.

Azure Synapse Analytics
Azure Synapse Analytics
An Azure analytics service that brings together data integration, enterprise data warehousing, and big data analytics. Previously known as Azure SQL Data Warehouse.
4,329 questions
Azure Databricks
Azure Databricks
An Apache Spark-based analytics platform optimized for Azure.
1,903 questions
Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
9,463 questions
{count} votes

1 answer

Sort by: Most helpful
  1. AnnuKumari-MSFT 30,361 Reputation points Microsoft Employee
    2022-09-23T13:17:18.193+00:00

    Hi @Anurag Yadav ,
    Welcome to Microsoft Q&A platform and thanks for posting your question here.

    You can try making use of substring() function or substringIndex() function to remove '[' and ']' from start and end.

    For example:

    Here I am trying to remove the leftmost and rightmost brackets from the following array of json: [{"items":[{"product_id":"123"}]}] by using substringIndex(substringIndex(Column_1, '[', -2),']',2)

    Please refer to the below screenshot:

    244361-image.png

    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
    1 person found this answer helpful.