listazureapi

Azure ADF - HTTP : Table from list


I'm new with ADF. I use a HTTP request (ex: myapi/users) to return a list of user id in a dataset delimitedtext:

This first request is not a JSON Array because of an error when i use a JSON Format, it return a simple text list: Text list

I need to convert this list in a new sql table:

USERID
6
8
15
18
....

Then I want to use this table for a new API REST request to return details of each users with a foreach capacity for each UserId in parameter

ex: myapi/users/{userid}

At the end I want to copy data in a new SQL Table:

USERID  |  FIRST NAME  |  TYPENO   | 
  6           NAME1         123
  8           NAME2         A125

I try to use the scenario of this tutorial REST API TUTORIAL

Thanks


Solution

  • I agree with @Nick.McDermaid that there is no need to convert it into table.

    This first request is not a JSON Array because of an error when i use a JSON Format, it return a simple text list: Text list

    As per the above, you have used a HTTP linked service and it might be the reason for you to get the dataset like above.

    If you are not able to resolve the error, you can try like below as a workaround. Give the HTTP linked service to a lookup activity. As per the above preview of dataset, it will give the output like below.

    enter image description here

    Now, convert this string into an array using this expression @json(activity('Lookup1').output.value[0].Prop_0) to use in Foreach. I have stored the array in a set variable.

    enter image description here

    Using this array in ForEach, you can get it done your requirement with a dynamic URL REST API(use @item() in it) as source to copy activity and SQL table as sink.

    (OR)

    You can try a web activity for first HTTP URL which will give the required JSON array.