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
Naman_
Regular Visitor

Loading multiple files from local to lakehouse

I used a gateway to connect to my local and if I try to access single file I willl able to load the file, but if I try to load a multiple files using foreach loop  I am getting an error, Could Anyone help me with this?

Naman__0-1734692861484.png

 

 

1 ACCEPTED SOLUTION
v-hashadapu
Community Support
Community Support

Hi @Naman_ ,Thank you for reaching out to Microsoft Fabric Community Forum.

 

Based on the error message, it appears that there is an issue with how the Copy data1 action is referenced within your ForEach loop.

Check the Action Placement in the ForEach Loop by Ensuring that the Copy data1 action is correctly placed within the ForEach loop and that it follows the correct runAfter or Trigger path.

Modify the Pipeline Configuration, it is needed to make sure that the Copy data1 action is appropriately linked in the workflow.

For example:

{

  "type": "ForEach",

  "name": "ForEachFile",

  "activities": [

    {

      "type": "Copy",

      "name": "Copy data1",

      "inputs": [

        {

          "type": "DatasetReference",

          "referenceName": "InputDataset"

        }

      ],

      "outputs": [

        {

          "type": "DatasetReference",

          "referenceName": "OutputDataset"

        }

      ],

      "runAfter": {

        "PreviousActivity": [

          "Succeeded"

        ]

      }

    }

  ]

}

If this helps, please mark it ‘Accept as Solution’, so others with similar queries may find it more easily. If not, please share the details.

View solution in original post

1 REPLY 1
v-hashadapu
Community Support
Community Support

Hi @Naman_ ,Thank you for reaching out to Microsoft Fabric Community Forum.

 

Based on the error message, it appears that there is an issue with how the Copy data1 action is referenced within your ForEach loop.

Check the Action Placement in the ForEach Loop by Ensuring that the Copy data1 action is correctly placed within the ForEach loop and that it follows the correct runAfter or Trigger path.

Modify the Pipeline Configuration, it is needed to make sure that the Copy data1 action is appropriately linked in the workflow.

For example:

{

  "type": "ForEach",

  "name": "ForEachFile",

  "activities": [

    {

      "type": "Copy",

      "name": "Copy data1",

      "inputs": [

        {

          "type": "DatasetReference",

          "referenceName": "InputDataset"

        }

      ],

      "outputs": [

        {

          "type": "DatasetReference",

          "referenceName": "OutputDataset"

        }

      ],

      "runAfter": {

        "PreviousActivity": [

          "Succeeded"

        ]

      }

    }

  ]

}

If this helps, please mark it ‘Accept as Solution’, so others with similar queries may find it more easily. If not, please share the details.

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.