Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join us at FabCon Vienna from September 15-18, 2025, for the ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM. Get registered

Reply
PanuO
Helper I
Helper I

Use iteration object in data copy mapping

I have dataflow which makes REST call to get different courses from API. For each course I need to get more detailed content. I have dataflow that uses Data Copy action to get all the courses and then I have For Each action that iterates every item received from API. I am able to do an another REST API call to get detailed course information, but the API response does not have the course identifier. I have it in the iteration item, but I cannot use it in mapping section. If I try to put item().id or {item().id} it produces an error:

ErrorCode=UserErrorSchemaMappingCannotInferSinkColumnType,'Type=Microsoft.DataTransfer.Common.Shared.HybridDeliveryException,Message=Data type of column 'id' can't be inferred from 1st row of data, please specify its data type in mappings of copy activity or structure of DataSet.,Source=Microsoft.DataTransfer.Common,'

 

Is there a way to use iteration object in mapping / should I do my dataflow in some another way? I have used the item().id in relative path, so I know it works there.

 

PanuO_0-1697030690307.png

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @PanuO ,

Can you please add column type to int (or respective type) and try to rerun the pipeline, let me know if you are still facing the same issue.

ttttt.png

Add on - Please refer these videos that might help you with your issue.

32. Copy data from REST API which sends response in Pages using Azure data factory - YouTube
21. Dynamic Column mapping in Copy Activity in Azure Data Factory - YouTube

Thank you

View solution in original post

5 REPLIES 5
Anonymous
Not applicable

Hi @PanuO  - Thanks for using Fabric Community,

As I understand you are trying to fetch data using API in Fabric Data Factory with the help of pipelines.

Can you please confirm if your pipeline design is similar to below screen shot?
ttt.png

Can you please share some details along with screenshots regarding your approach and issue.
I would be able to help you better if you can provide these details.

That is quite close. I now have datalake as input, because it is faster to test that way (I have stored data in there so I don't want to fetch it all the time when I test this).

The foreach has following Items setting: 

@activity('Get courses from datalake').output.value
This is the pipeline:

PanuO_0-1697103914846.png

 

Anonymous
Not applicable

Hi @PanuO  - Thanks for your response.

Can you please share a complete screenshot of for loop settings and copy data activity settings.

Eg:
For Loop -

vgchennamsft_1-1697105948738.png

 



Copy Data -

vgchennamsft_0-1697106365925.png

 



vgchennamsft_0-1697105897388.png

 

Loop:

PanuO_2-1697106401941.png

 

 

Copy Data:

PanuO_1-1697106360962.png

(The API has result objects inside array called results, so thats why I need to use the collection reference in mapping)

Anonymous
Not applicable

Hi @PanuO ,

Can you please add column type to int (or respective type) and try to rerun the pipeline, let me know if you are still facing the same issue.

ttttt.png

Add on - Please refer these videos that might help you with your issue.

32. Copy data from REST API which sends response in Pages using Azure data factory - YouTube
21. Dynamic Column mapping in Copy Activity in Azure Data Factory - YouTube

Thank you

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June FBC25 Carousel

Fabric Monthly Update - June 2025

Check out the June 2025 Fabric update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.