ADF dataflow externalCall Output Body

Jan Re 21 Reputation points
2022-09-16T21:49:21.303+00:00

Hi all, I am setting up my first data flow in ADF. I started with a pipeline and dropped the data flow object on the canvas and am stuck with setting up the flow when it comes to calling an external API. I setup my MySQL source just fine. Then I create a derived column to make a field that contains the query string parameters needed for the REST call. In my testing I am using https://catfact.ninja/ to test creating an external call. This as basic as it gets when calling and API.

For example a call to this url:

https://catfact.ninja/fact?max_length=100

returns:

{"fact":"Every year, nearly four million cats are eaten in Asia.","length":55}

(Sorry cats)

For the derived column I am just making a static string value for the query string parameter required by the API:

242051-image.png

When creating the output body I create this in the expression builder:

242031-image.png

Per the example I am following I feel this is correct.

I am using https://catfact.ninja/fact as the base url to the service. And this is the rest of the settings for the externalCall component:

242042-image.png

The preview shows an empty field, other APIs I've tried to add usually have null, but in any case the result from the API is not being captured:

242034-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. KranthiPakala-MSFT 46,642 Reputation points Microsoft Employee Moderator
    2022-09-27T21:24:50.047+00:00

    Hello anonymous usere-7330,

    I was able to get this work by following the below series of steps.

    1. I have created the output body as same as yours. 245237-image.png
      1. Then in external call transformation data preview I saw the response same as yours:
      245302-image.png
      1. From the data preview result click on Map drifted option which will create a derive column transformation and selects the drifted columns from your actual source.
      245228-image.png
      1. Then in Mapdrifted (nothing but a derived column transformation for drifted columns) select the body.fact and body.length columns and give desired columns names as shown below.
      245238-image.png

    Please note : In case if you don't see MapDrifted option in external call transformation data preview, you can explicitly create a derived column transformation and select body.fact, body.length along with source columns as shown in above image.

    1. Then have a select transformation to only select the necessary columns that have to be mapped to your sink. 245229-image.png

    Then do a data preview which will show the results as required for your sink data store.

    245303-image.png

    Hope this helps. Do let us know if you have further query.


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