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 / Error - Initialize Arr...
Power Automate
Answered

Error - Initialize Array Variable with JSON Objects

(0) ShareShare
ReportReport
Posted on by 67

Hi, sorry if this is painfully obvious. I am trying to initialize an array variable with JSON objects, but PA returns the error message "The variable 'groupArray' of type 'Array' cannot be initialized or updated with value of type 'String'. " Why is it reading this as a string? 

 

The array looks like this:

[

{

"Group":"",

"RBT":"",

"InvoiceNumber":"",

"InvoiceName":"",

"ServiceSummary":"",

"AuditDescription":"",

"AuditSummary":"",

"DepartmentNumber":""

},
{

"Group":"Group1",

"RBT":"RBT1",

"InvoiceNumber":"Invoice1",

"InvoiceName":"InvoiceName1",

"ServiceSummary":"Summary1",

"AuditDescription":"N/A",

"AuditSummary":"N/A",

"DepartmentNumber":"N/A"

}

]

alexleetoo17_0-1666113418412.png

 

There are numerous other objects but they're loaded with proprietary data so I've just added a blank object and one with dummy values here. Thanks in advance!

Categories:
I have the same question (0)
  • Redders Profile Picture
    546 on at

    Have you tried it without the square brackets?

  • Verified answer
    alexleetoo17 Profile Picture
    67 on at

    I figured out every item inside the square brackets had to be in double quotes (so my curly brackets had to be inside quotes, e.g. "{'Group'}"), and that let me initialize the variable. But it turned out I needed the Compose action to make the array functional anyway. Thanks though!

     

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
Haque Profile Picture

Haque 589

#2
Valantis Profile Picture

Valantis 328

#3
David_MA Profile Picture

David_MA 284 Super User 2026 Season 1

Last 30 days Overall leaderboard