cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
poortom1004
Regular Visitor

Error running Flow on an initialize array step

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 éâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñÑ

1 ACCEPTED SOLUTION

Accepted Solutions
poortom1004
Regular Visitor

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 "\\"

View solution in original post

4 REPLIES 4
abm
Super User III
Super User III

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


Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blogPower Automate Video Tutorials
poortom1004
Regular Visitor

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?

poortom1004
Regular Visitor

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 "\\"

View solution in original post

Hi @poortom1004 

 

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

 

Thanks



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blogPower Automate Video Tutorials

Helpful resources

Announcements
MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MSFTBizAppsLaunchEvent

Experience what’s next for Power Virtual Agents

See the latest Power Automate innovations, updates, and demos from the Microsoft Business Applications Launch Event.

New Super Users

Meet the Power Automate Super Users!

Many congratulations to the Season 1 2021 Flownaut Crew!

Power Platform ISV STudio

Power Platform ISV Studio

ISV Studio is the go-to Power Platform destination for ISV’s to monitor & manage applications post-AppSource publish.

Top Solution Authors
Users online (31,253)