@item() in foreach causing error

Ryan Abbey 1,171 Reputation points
2021-11-07T22:01:42.917+00:00

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
147153-image.png

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.
4,356 questions
Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
9,513 questions
{count} votes

1 answer

Sort by: Most helpful
  1. ShaikMaheer-MSFT 37,896 Reputation points Microsoft Employee
    2021-11-08T14:18:31.807+00:00

    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.