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 is being recogni...
Power Automate
Answered

Array is being recognized as an object

(0) ShareShare
ReportReport
Posted on by 14

Good Day, 

I am trying to create an build an array to perform a dynamic create email record in ms dynamics connector using flows. 

The aim is to basically send an email to all staff members within a specific team/Organisational unit dynamically. 

 

after some research, i came upon a way to get it done by creating the json array and append the records to it using this array structure : 

 

{
"participationtypemask": 1,
"partyid@odata.bind": "systemusers(@{items('Apply_to_each_4')?['systemuserid']})"
}

 

where 1 means From and 2 is the To address. 

 

when i try to set the array using this exact line im getting the error -

 

BadRequest. The variable 'Email Recipient' of type 'Array' cannot be initialized or updated with value of type 'Object'. The variable 'Email Recipient' only supports values of types 'Array'.

 

this is a new error aswell ass this worked up to a few months ago. 

 

Can anyone assist me in figuring out a way to either fix the error or accomplish my aim in an easier manner ? 

 

PS. the reason im using the dataverse create record to send emails is so that i can track it properly in MS dynamics email tracking 

Categories:
I have the same question (0)
  • Verified answer
    v-bofeng-msft Profile Picture
    Microsoft Employee on at

    Hi @kale99 :

    This is an object

     

    {
    "participationtypemask": 1,
    "partyid@odata.bind": "systemusers(@{items('Apply_to_each_4')?['systemuserid']})"
    }

     

    And this is a array

     

    [
    {
    "participationtypemask": 1,
    "partyid@odata.bind": "systemusers(@{items('Apply_to_each_4')?['systemuserid']})"
    }
    ]

    I think these links will help you a lot:

    JSON Object 

    JSON Array 

     

     

    Best Regards,

    Bof

  • DudelerDad Profile Picture
    47 on at

    Thanks this solved my problem by adding the brackets.
    Still getting very strange behavior because this only happens in the middle Case option of my switch.

    Setting the variable works fine without the brackets for the first switch option and the last switch option.

    DudelerDad_0-1671200565428.png

    And if I add brackets to the first and third Case options I get an error on Save.

     

    Flow save failed with code 'WorkflowRunActionInputsInvalidProperty' and message 'The inputs of workflow run action 'NewHireWelcomeLetter-YES' of type 'AppendToArrayVariable' are not valid. The provided value of '[ { "Selected": "YES", "Training Requirements": "New Hire Welcome Letter", "Additional Note": "@outputs('Get_item-TrainingRequirements')?['body/Send_x0020_welcome_x0020_letter_']", "Date": "@variables('varTimeNow')" } ]' of type 'Array' must be a primitive type, or a valid template language expression.'.

     

    Another thing I notice when looking at the Peek code.

    DudelerDad_2-1671201234180.png

    Case 2 is now working as shown.

    Anyways your solution helped me immensely even if I don't know why it is working. 😀

     

     

    2022-12-16 09_41_23-Edit your flow _ Power Automate — Mozilla Firefox.png
    2022-12-16 09_30_41-Edit your flow _ Power Automate — Mozilla Firefox - Copy.png

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 77 Super User 2026 Season 1

#2
Haque Profile Picture

Haque 68

#3
Expiscornovus Profile Picture

Expiscornovus 56 Most Valuable Professional

Last 30 days Overall leaderboard