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 / Array must be of primi...
Power Automate
Answered

Array must be of primitive type error when appending to an array variable

(0) ShareShare
ReportReport
Posted on by 546

Hi everyone,

I'm trying to append to an array variable, and I'm getting an error.

Flow save failed with code 'WorkflowRunActionInputsInvalidProperty' and message 'The inputs of workflow run action 'Append_to_array_variable' of type 'AppendToArrayVariable' are not valid. The provided value of '[ { "Claims": "@items('Apply_to_each')?['Approver_x0020_email']" } ]' of type 'Array' must be a primitive type, or a valid template language expression.'.

The workflow itself is pretty simple:

 

appenderror.jpg

Any thoughts?

Categories:
I have the same question (0)
  • tom_riha Profile Picture
    10,185 Most Valuable Professional on at

    Hello @smorley ,

    remove the [ and ] brackets from the 'Append to array variable' value. [ ] brackets define an array, Power Automate thinks you want to add an array into another array. But you want to add only the value inside the { } (including the brackets) into an array, I guess you're trying to achieve this:

    [
     { "Claims": "user1@company.com" },
     { "Claims": "user2@company.com" }
    ]

    You could achieve the same result also with the 'Select' action instead of 'Apply to each' + 'Append to an array variable'.image.png

     

  • smorley Profile Picture
    546 on at

    Thanks @Anonymous the error went away, but now when I run the flow, it skips over the append action.  skiparray.jpg

    My append syntax is:

    {
    "Claims": @{items('Apply_to_each_2')?['Approver_x0020_email']}
    }

  • smorley Profile Picture
    546 on at

    @tom_riha Sorry to be a pest.  I tried the select statement, but I've never used it before.  When I try it, it wraps inside an apply to each action.

    In any case.  I'm going to explain my workflow and what I'm trying to solve.

     

    A person fills out a form, and I want to populate the approver people picker field with a workflow, which comes from a second list that has the approver information.  It could also be from a SP group, I'm not fussy at this point.

  • tom_riha Profile Picture
    10,185 Most Valuable Professional on at

    Hello @smorley ,

    when you lookup the other list using 'Get items', it'll always return an array = it'll always add 'Apply to each'. If it returns just 1 item it's not a problem as it'll loop only once through that 1 item.

    Then the 'Select' action works in a way that you'll input an array = multiple choice people picker, and select from all the available information on the email address. The full content of a multiple people picker column will look like this:

    [
     {
     "@odata.type": "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
     "Claims": "i:0#.f|membership|user1@company.com",
     "DisplayName": "User One",
     "Email": "user1@company.com",
     "Picture": "https://..."
     },
     {
     "@odata.type": "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
     "Claims": "i:0#.f|membership|user2@company.com",
     "DisplayName": "User Two",
     "Email": "user2@company.com",
     "Picture": "https://..."
     }
    ],

    With the 'Select' action you can take that array, and tell the flow to return only a specific property from that array. You define the 'key' = Claims and the value you want to assign to that key in the result = Approver Email.

  • smorley Profile Picture
    546 on at

    @tom_riha I now have this in my select statement

    selectsyntax.jpg

    From is the SP field Approver Name which is a people picker field, and the Map is using the field Approver Email.  

    (Which I think is my problem.)

    My update item keeps giving an error when I put the output from the select statement in the Approver Claims field.updateitem.jpg

     

  • tom_riha Profile Picture
    10,185 Most Valuable Professional on at

    Try to switch to the text editor in the 'Approver Claims' field and use the variable there.

    image.png

     

  • smorley Profile Picture
    546 on at

    I'm thinking I'm close but not yet.

    approverclaims.jpg

  • tom_riha Profile Picture
    10,185 Most Valuable Professional on at

    'Current item' is connected to an 'Apply to each' action, it can't be used outside of 'Apply to each' as it references the item from the array you currently process. In the 'Update item' you should use either the output from the 'Select' action, or, if you can't access the output from the 'Select' action outside of the 'Apply to each', initialize an array variable at the beginning of the flow and store the output from the 'Select' into the variable (within the 'Apply to each').

    Then use that array variable in the 'Update item' action.

  • smorley Profile Picture
    546 on at

    Here is my select statement.

    From is Approver_x0020_Name

    Map: enter key is blank;  the SP is Appover_x0020_Name_Email

    Is this correct?

    selectstatement.jpg

    If not, should it be this:

    selectstatement2.jpg

    If it's not quite correct should it be "Approver Name Claims" here?

     

    Sorry for being dense.

  • tom_riha Profile Picture
    10,185 Most Valuable Professional on at

    I think we're getting lost here with the 'Select' action and it'll be easier if you go back to the original solution with the 'Append to array variable' action. Just remove the [ and ] and then update the 'Approver' column using that array variable.

     

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 112 Super User 2026 Season 1

#2
Haque Profile Picture

Haque 52

#3
Ellis Karim Profile Picture

Ellis Karim 51 Super User 2026 Season 1

Last 30 days Overall leaderboard