web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Getting "expression no...
Power Automate
Suggested Answer

Getting "expression not valid" when attempting to append to a 2D array

(1) ShareShare
ReportReport
Posted on by 2
Hello, I have a list of names formatted as Last,First Middle. I want to parse each name into First Last and then store both the original and parsed names into an array with 2 columns. I've already figured out how to parse the names, but I'm having trouble appending items.
 
This is what my flow looks like:
 
In the Value field for the Append to variable function, this is what I put:
 
{
"Name":"outputs('Compose')",
"RawName":"items('Apply_to_each_3')?['Name']"
}
 

But I'm getting an error saying that my expression is invalid when I try to save it. What's wrong with my expression?

 
Categories:
I have the same question (0)
  • Suggested answer
    11manish Profile Picture
    3,812 on at
    Use json() expression
     
    You can also construct the object using a single expression:
     
    json(
      concat(
        '{"Name":"',
        outputs('Compose'),
        '","RawName":"',
        items('Apply_to_each_3')?['Name'],
        '"}'
      )
    )


    Expected array output
     
    After each iteration, your array should look like:
     
    [
      {
        "Name": "John Smith",
        "RawName": "Smith,John A"
      },
      {
        "Name": "Jane Doe",
        "RawName": "Doe,Jane M"
      }
    ]
     

     
  • Suggested answer
    Haque Profile Picture
    3,971 on at

    Hi @SL-31031705-0,

    Are you putting the dynamic content inside quotes?  I guess this quotes make them literal strings rather than expressions to be evaluated.

    Instead of this:

    {
      "Name":"outputs('Compose')",
      "RawName":"items('Apply_to_each_3')?['Name']"
    }
    

    Let's remove the quotes around the expression so PA treats them as expression like below:

     

    {
      "Name": outputs('Compose'),
      "RawName": items('Apply_to_each_3')?['Name']
    }
    
     
    When you work with Append to array variable action, in the Value, switch to the Expression tab  for each property value. So let's enter the expressions without quotes: for Name: outputs('Compose') and for RawName: items('Apply_to_each_3')?['Name']
     
     
     

    I am sure some clues I tried to give. If these clues help to resolve the issue brought you by here, please don't forget to check the box Does this answer your question? At the same time, I am pretty sure you have liked the response!
     

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.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 295 Super User 2026 Season 1

#2
11manish Profile Picture

11manish 152

#3
Haque Profile Picture

Haque 125

Last 30 days Overall leaderboard