AutomateAlong

Error messages › Expressions

Apply to each was given something that isn't a list

Seen when a run fails · Updated 8 November 2026

The message

The execution of template action 'Apply_to_each' failed: the result of the evaluation of 'foreach' expression '@body('Get_items')' is of type 'Object'. The result must be a valid array.

What it means

The loop points at the whole output of a step instead of the list inside it. Most 'Get' actions return an object with the list under value.

How to fix it

  1. Change the loop's input to the list itself: body('Get_items')?['value'] (or pick 'value' from dynamic content).
  2. If the step returns one item, you don't need the loop at all.

Not quite your message? Paste the whole thing into the Flow Doctor. It reads the step, property and expression out of your exact wording and, for the stubborn ones, the AI reads the flow it happened in.

How to find the full error in Power Automate

  1. Open the flow and look at 28-day run history.
  2. Select the failed run (red cross), then the step with the red cross.
  3. The error is in that step's box; some are under Show raw outputs. Copy the whole thing, including the code at the start.

Other Expressions errors

AutomateAlong is independent and isn't affiliated with Microsoft. Microsoft and Power Automate are trademarks of the Microsoft group of companies.