Skip to main content

Notifications

Community site session details

Community site session details

Session Id : m+O7D5f2hMduOyueR/eFom
Power Automate - General Discussion
Unanswered

Array' cannot be initialized or updated with value of type 'String'.

Like (2) ShareShare
ReportReport
Posted on 24 Nov 2021 12:30:36 by 86

Hello everyone,

 

I' m trying to initialize a variable like shown on the screenshot but getting an error message 

The variable 'vAuthorization' of type 'Array' cannot be initialized or updated with value of type 'String'. The variable 'vAuthorization' only supports values of types 'Array'. I'm a bit confuced by this error cause I have checked everything and array format should be fine. Please advise!

 

nikitamobile85_0-1637756846486.png

 

[
{
"Postion": "Applicant",
"Name": "@{triggerOutputs()?['body/Author/DisplayName']}",
"Status": "Submitted",
"Date": "@{formatDateTime(triggerOutputs()?['body/Created'], 'yyyy-MM-dd')}",
"Signature": ""
},
{
"Postion": "MNG",
"Name": "@{triggerOutputs()?['body/General_x0020_Manager/DisplayName']}",
"Status": "@{outputs('Get_item')?['body/General_x0020_Manager_x0020_appr/Value']}",
"Date": "",
"Signature": ""
},
{
"Postion": "DGM",
"Name": "@{triggerOutputs()?['body/Deputy_x0020_General_x0020_Manag/DisplayName']}",
"Status": "@{outputs('Get_item')?['body/DGM_x0020_approval/Value']}",
"Date": "",
"Signature": ""
},
{
"Postion": "GM",
"Name": "@{triggerOutputs()?['body/Manager/DisplayName']}",
"Status": "@{outputs('Get_item')?['body/Manager_x0020_approval/Value']}",
"Date": "",
"Signature": ""
},
{
"Postion": "Chief Accountant/FD Asst Manager",
"Name": "@{triggerOutputs()?['body/Chief_x0020_Accountant/DisplayName']}",
"Status": "@{triggerOutputs()?['body/Chief_x0020_Accountant_x0020_app/Value']}",
"Date": "",
"Signature": ""
},
{
"Postion": "FD Deputy GM",
"Name": "@{triggerOutputs()?['body/FD_x0020_Deputy_x0020_GM/DisplayName']}",
"Status": "@{outputs('Get_item')?['body/FD_x0020_Deputy_x0020_GM_x0020_a/Value']}",
"Date": "",
"Signature": ""
},
{
"Postion": "GD",
"Name": "@{triggerOutputs()?['body/General_x0020_Director0/DisplayName']}",
"Status": "@{outputs('Get_item')?['body/General_x0020_Director/Value']}",
"Date": "",
"Signature": ""
}
]

  • ShantanuSri Profile Picture
    19 on 15 May 2024 at 07:15:31
    Re: Array' cannot be initialized or updated with value of type 'String'.

    WOW !!

     

    Thanks a ton @Chriddle . That worked like a charm ! 🙂

  • Chriddle Profile Picture
    7,678 Super User 2025 Season 1 on 15 May 2024 at 07:03:08
    Re: Array' cannot be initialized or updated with value of type 'String'.

    There is an error in the JSON. Therefore it is a String.

    Remove the last comma from the value of the variable.

  • ShantanuSri Profile Picture
    19 on 15 May 2024 at 06:06:14
    Re: Array' cannot be initialized or updated with value of type 'String'.

    I am trying to set some variables as a .csv table which i will use later, but this flow is failing with the error stated in one of the screenshots.

     

    ShantanuSri_0-1715753050018.png

    ShantanuSri_1-1715753092479.png

     

     

  • VictorIvanidze Profile Picture
    12,212 on 14 May 2024 at 18:27:12
    Re: Array' cannot be initialized or updated with value of type 'String'.

    @ShantanuSri,

     

    you have initialized an empty array. And what's your problem? 

  • ShantanuSri Profile Picture
    19 on 14 May 2024 at 15:45:04
    Re: Array' cannot be initialized or updated with value of type 'String'.

    @VictorIvanidze I have the same issue; I have attached my Initialize variable in edit mode.

    Could you please take a look ?

    ShantanuSri_0-1715701424912.png

     

  • deimos Profile Picture
    8 on 27 Jun 2023 at 21:01:46
    Re: Array' cannot be initialized or updated with value of type 'String'.

    My goodness, truly a pro tip. I spent over an hour trying to figure out why my Array wouldnt take my values - turns out there was a pre-emptive line break that was hidden! Thank you.

  • kethr Profile Picture
    6 on 19 Jun 2023 at 14:50:43
    Re: Array' cannot be initialized or updated with value of type 'String'.

    posting my solution here... problem was Microsoft Word and it's fancy fonts. I had an excel with 150+ rows. Copy/paste-as-text'd this to Word to use it's find/replace feature to swap out special character (paragraph) to:
    ",^l"

    that changed the unprintable paragraph marks (from excel) to quote comma new-line quote .. that gave me the basic structure, just needed to add [ and ] at the beginning and end. Got the exact same error as you. and the quote marks look identical.... ... 

    Then I went to my favourite app for this kinda thing. Notepad. Pasted the array and the quotes were the stupid left/right 66 and 99 icons. I did a find replace in notepad for actual double-quote marks " (unicode: ALT-34)

    Copy/pasted everything back in to the powerautomate initialize array function and voila. Green checkbox. 

     

    Someone else in the thread asked "are you sure it was the right type of quotes"... so i guess that was the same as i'm saying: 

    Curly-quotes “”  and double-quotes " are NOT the same 

  • CW Profile Picture
    1,040 on 18 May 2023 at 20:45:51
    Re: Array' cannot be initialized or updated with value of type 'String'.

    Thanks for sharing that!! How many people wasted a lot of time trying to figure it out when all along, all it required was the typical WORKAROUND/HACK when as you said it should work as expected.
    I wonder if it had something to do with it not being a Tuesday with a full moon??

  • MadMuck Profile Picture
    74 on 18 May 2023 at 15:25:36
    Re: Array' cannot be initialized or updated with value of type 'String'.

    Just because I had this issue today and found this post, I thought I'd share my solution in case it helps someone else in the same boat.

     

    For me, this was just a matter of Power Automate being finicky.  I had an "Initialize variable" action originally set to a string type, but later I changed it to an array type without changing the value and began receiving the OP's error.  To resolve the error, I did this:

    1. Changed the variable's name
    2. Created a second "Initialize variable" action and set its type to "Array"
    3. Gave the variable in this new action the name of my original variable
    4. Copied the formula in my original action to the new action for a value
    5. Save & Test!

    At this point, both actions were successful.  I was able to change the name of my original variable back to what it was and remove the second action, and it continued to work after this.  I guess Power Automate just needed a small bonk to the noggin to work as expected.

  • ChrisMSK Profile Picture
    4 on 11 Mar 2023 at 19:43:49
    Re: Array' cannot be initialized or updated with value of type 'String'.

    Build the dynamic json string in a variable (firstVarWithJsonString), and make that variable a string. 

     

    In the next variable, the one that is set as type "array" you can use this expression.

    json(variables('firstVarWithJsonString'))

     

    This is the missing part.  This finally worked for me.  Its very selective, but it does make sense, you convert the string, into JSON (even when the string looked like json, but Logic App does not know this) you have to convert the string to a json object, then the "array" type works. 

     

     
    ChrisMSK_0-1678563607805.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

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,668 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,004 Most Valuable Professional

Leaderboard