Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Using Flows
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 

  • DudelerDad Profile Picture
    47 on at
    Re: Array is being recognized as an object

    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. 😀

     

     

  • Verified answer
    v-bofeng-msft Profile Picture
    on at
    Re: Array is being recognized as an object

    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

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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,700 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,015 Most Valuable Professional

Leaderboard

Featured topics

Restore a deleted flow