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 running Flow on ...
Power Automate
Unanswered

Error running Flow on an initialize array step

(0) ShareShare
ReportReport
Posted on by 11

I was able to save my flow (no syntax issue) with an initialize variable step, type is array.  The purpose of the array is to hold characters that I want to strip from a value in a further step inside of an Apply to Each step.

I was following the guidance on this page: Remove unwanted characters from a string in Power Automate (tachytelic.net)

When I go to run the flow, I get an error stating the following:
The variable 'RemoveCharsArray' of type 'Array' cannot be initialized or updated with value of type 'String'. The variable 'RemoveCharsArray' only supports values of types 'Array'.

The value for the RemoveCharsArray is the following:

[" ","\","/","%","&","*","+","=","?","{","}","|","<",">","(",")",";",":",",","[","]","~","`","é","â","ä","à","å","ç","ê","ë","è","ï","î","ì","Ä","Å","É","æ","Æ","ô","ö","ò","û","ù","ÿ","Ö","Ü","¢","£","¥","₧","ƒ","á","í","ó","ú","ñ","Ñ","Char(34)"]

As you might be able to tell, I am wanting the array to contain these characters, which will end up being removed from an input of a previous step.

The characters I am wanting to remove are the following:

space
backslash \
percent %
ampersand &
asterisk *
plus +
slash /
equality sign =
question mark ?
left curly bracket {
right curly bracket }
veritcal bar |
less than <
greater than >
left parenthesis (
right parenthesis )
semicolon ;
colon :
comma ,
left square bracket [
right square bracket ]
double quote " (Escaped by Char34)
tilde ~
accent `
at sign @
period .
diacritical characters éâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñÑ

Categories:
I have the same question (0)
  • abm abm Profile Picture
    32,858 Most Valuable Professional on at

    Hi @poortom1004 

     

    There may be couple of ways to do this.

     

    image.png

     

    image.png

    Above expression I used is as follows:

    split(variables('SpecialCharacters'),',')
     
    Above I have initialised an array and declared all the characters in a string. Then in next step I used the expression split to separate each values and append to array. Finally you have an array with all those characters.
     
    image.png
     
    Thanks
  • poortom1004 Profile Picture
    11 on at

    This doesn't work.  I get the same error.  Can someone help me troubleshoot the error instead of providing a different way of doing things?

  • Verified answer
    poortom1004 Profile Picture
    11 on at

    I ended up fixing this.  The backslash (\) was getting escaped when I didn't want it to.  To get around this, I used the unicode equivalent "\u005C" in place of "\".  After I saved the flow, the array values automatically converted the unicode value back into the backslash along with the proper escaping required, which ended up being "\"".  Additionally, I was wanting to have the double quote character in the array, and the way I was using it was apparently wrong, so I used the same method of using the unicode value \u0022, which again after I saved the flow, automatically updated the array value to "\\"

  • abm abm Profile Picture
    32,858 Most Valuable Professional on at

    Hi @poortom1004 

     

    I tested this and it does work. Send me your email id and I could forward my flow for you.

     

    Thanks

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