Azure data Factory - passing in Json array/Object into web connector

Mike Wong 46 Reputation points


I'm currently building a pipeline where I am calling a REST API using the web connector and then using the Copy Activity to save the data to a SQL DB. The API URL I want to use has the following structure:[{"param1": "subparam1", "param2": "subparam2"}]

I can ping this endpoint fine in Python although having trouble building this in the Add Dynamic content section. I am currently trying:

'&sort=[{"param1": "subparam1", "param2": "subparam2"}]'})

although this keeps erroring out. I've tried passing in the last part as follows:

@json (string(&sort=[{"param1": "subparam1", "param2": "subparam2"}])
string(&sort=[{"param1": "subparam1", "param2": "subparam2"}])
&sort=[[{<!-- -->{"param1": "subparam1", "param2": "subparam2"}}]]
&sort=[{""param1"": ""subparam1"", ""param2"": ""subparam2""}]
&sort=[{<!-- -->{"param1": "subparam1", "param2": "subparam2"}}]
&sort=[[{"param1": "subparam1", "param2": "subparam2"}]

However, I keep getting an error. I presume it's because of the way Data Factory is parsing this as a string.

Any explanation or help would be great.

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

1 answer

Sort by: Most helpful
  1. HimanshuSinha-msft 19,386 Reputation points Microsoft Employee

    Hello @Mike Wong ,
    Thanks for the ask and using Microsoft Q&A platform
    Can you please this expression and it should work ? ('[{','''''param1''''' ,': ','''''subparam1''''',': ','''''param2''''',': ','''''subparam2''''','}]')

    Please do let me know how it goes .

    • 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