Thanks for reaching out to Microsoft Q&A
The issue lies in how the data is being processed and inserted into the SQL Server table. To ensure that each id
is inserted as an individual record, you can use a Data Flow in Azure Data Factory. Here’s how you can do it:
Create a Data Flow:
- In your ADF pipeline, add a Data Flow activity.
- Create a new Data Flow and add a source transformation.
Source Transformation:
- Configure the source to read from your API response.
- Use the JSONPath expression
$.batches[*].id
to extract theid
values.
Flatten Transformation:
- Add a Flatten transformation to convert the array of
id
values into individual rows. - In the Flatten transformation, set the unroll by field to the
id
array.
Sink Transformation:
- Add a Sink transformation to write the data to your SQL Server table.
- Map the
id
field to the corresponding column in your SQL Server table.
This configuration will ensure that each id
is treated as a separate record and inserted individually into your SQL Server table.
Hope this helps. Do let us know if you any further queries.