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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Array is being recogni...
Power Automate
Unanswered

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

     

     

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard