I’ve created a Power Automate flow that’s meant to extract tasks from Microsoft Planner and update an Excel file stored in OneDrive for Business. The goal is to make it easier for my manager to track team progress and build Power BI reports on top of that Excel data. Here’s how the flow is structured so far:
Later steps will insert task details into Excel, including assignee names.
Issue:
I keep getting this error on the Apply to each step: "The input parameter(s) of operation 'Apply_to_each' contains invalid expression(s)." Even though the Compose step returns a valid array (I’ve checked this with Peek Code and test outputs), the flow won’t save or run properly.
What I’ve tried:
Rebuilt the Apply to each from scratch
Used expression:
outputs('Compose')
Removed any newlines from expressions (e.g., \r\n)
Checked that Compose outputs a proper JSON array of userId objects
Question:
Could the issue be caused by something inside the loop (like the Get user profile step)? Or is there something I’m missing about how Power Automate handles these arrays? Would appreciate any tips — especially if you’ve run into a similar issue before. Thanks in advance.
Can you show your flow and especially the configuration of the action that generated the error message? You mention an array, but in your flow outline you don't describe an array. Are you referring to the string variable as an array?
You may want to try this instead:
Replace the string variable with an array variable and set the default value to []
Replace the append to string variable with an append to array variable
In the append to array variable, only populate it with the dynamic content you were appending in the string variable and nothing else.
Then wherever you need to use the variable, you can use this expression to join the values from the array together as a string: join(variables('AssignedNames'), ', ')
You can replace the comma in the above expression with anything you want to join the values with. Based on the error message, you are using an expression somewhere to do this with a semicolon. However, you would do this outside of the apply to each action.
Was this reply helpful?YesNo
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.