@item() in foreach causing error

Ryan Abbey 1,106 Reputation points

This is a screenshot of an entire pipeline... one lookup and one foreach... there is no reference to "@item" in either the lookup or as any variable or other section outside of the foreach

Yet, the following error is displaying

@item() syntax can only be used in the filter activity or child activities of a foreach activity

This is in a pipeline that has been run many times with no change between its last run on Friday afternoon and now.

All references to "@item" are within a child of the foreach (that is, grandchildren of the foreach), I would truly hope MS hasn't made a change that prevents that!!

Azure Synapse Analytics
Azure Synapse Analytics
An Azure analytics service that brings together data integration, enterprise data warehousing, and big data analytics. Previously known as Azure SQL Data Warehouse.
2,868 questions
Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
6,700 questions
{count} votes

1 answer

Sort by: Most helpful
  1. ShaikMaheer-MSFT 30,196 Reputation points Microsoft Employee

    Hi @Ryan Abbey ,

    Thank you for posting query in Microsoft Q&A Platform.

    It looks strange. You mentioned that in lookup or ForEach level you haven't used @item expression still getting error.

    Could you please try below option and see how it goes.

    If you are trying to pass @item() inside ForEach to child or Grand child. Then, kindly have @item() value set in to a variable first and then pass that variable into child or grand child of ForEach. I hope this may avoid issue. Kindly try and share updates.

    Please consider Accepting answer if this helps. Please let us know if any further queries.