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

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

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