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 / The variable 'varAppro...
Power Automate
Unanswered

The variable 'varApprovers' of type 'Array' cannot be initialized or updated with value of type 'String'. The variable 'varApprovers' only supports values of types 'Array'.

(0) ShareShare
ReportReport
Posted on by 19

This post relates to youtube video : https://www.youtube.com/watch?v=gb_FUeRjgg4

 

where in the example code posted to github produces the error "The variable 'varApprovers' of type 'Array' cannot be initialized or updated with value of type 'String'. The variable 'varApprovers' only supports values of types 'Array'."

 

The final setup shows an update to the varApprovalHistory which was previously defined as an array

leverson_1-1666817718710.png

joined 

leverson_2-1666818125824.png

and then attempts to update (using set variable) as a string

leverson_0-1666817627987.png

 

what should be the correct way to update this? 

I assume it shoudl be an append to array variable not a "set variable"

 

Question for @rezza

 

 

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

    Hi @leverson,

     

    I found the video around the section that you are talking about quite hard to follow however, I have done this flow in a small attempt to replicate

     

    Redders_4-1666821055811.png

    Redders_5-1666821072119.png

     

    Here is the result

    Redders_6-1666821152992.png

    Redders_7-1666821163103.png

    Redders_8-1666821189251.png

    Redders_9-1666821211238.png

    Redders_10-1666821231081.png

     

    The point being is that I don't think that you need to add the last step 

    Redders_11-1666821579422.png

     

    Just update your item with the output from the join

     

    I hope that this helps you, if you liked my response, please consider giving it a 👍If I have answered your , please mark my post as ✔️.

     

    Solved questions helps users in the future who may have the same issue or question quickly find a resolution via search. Thank you!

     

     

     

     

     

  • grantjenkins Profile Picture
    11,063 Moderator on at

    One thing to note here is that you initialize an empty array varApprovalHistory and they try to join this with your string "-------------", but you have no items in your array to join (your array is empty).

     

    And then you assign the value of Approval History from SharePoint to the array which seems to be of type string which is why you get the error.

     

    What you want to do it add your items to the array first and then join them with "-----------------".

     

    To give you the proper solution we need to know what's contained in your Approval History item you are getting from SharePoint. Can you share the output from Approval History to see what you are trying to join?

     

     

  • Mryan3001 Profile Picture
    8 on at

    I am having the same issue. This is the message : 

    BadRequest. The variable 'varApprovalHistory' of type 'Array' cannot be initialized or updated with value of type 'String'. The variable 'varApprovalHistory' only supports values of types 'Array'.
     
    However, the SharePoint list still updates correctly. How is this possible?

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 462 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 456 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard