cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Dual Super User III
Dual Super User III

Array variables initialization error

Hi

I am having problems with Initialize Variable action block. If I set its inputs values to the following:wrongArray.png

 

...and then execute the flow I get the following error message:

 

The variable 'InputDictionary' of type 'Array' cannot be initialized or updated with value '[["{","{"],["}","}"],["\","\"]]' of type 'String'. The variable 'InputDictionary' only supports values of types 'Array'. 

 

However, if I set the its inputs values to the following:

rightArray.png

 

 

...and then execute the flow, I do not get any error.

 

rightArraySucceeded.png

 

Suggestions are welcome!



Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



3 REPLIES 3
Highlighted
Helper V
Helper V

Re: Array variables initialization error

May I know what are you trying to do?

Highlighted
Dual Super User III
Dual Super User III

Re: Array variables initialization error

Sure... I am trying to replace some characters from a string into their ascii equivalents. I am using an array of arrays to declare the pairs.

 

My first approach was to add an action block per replacement.

Then I thought it was easier to implement an array of arrays (character-translation pairs); so if I need to add a new translation pair, it will be faster to implement. A similar approach is detailed in this post by @petervdzande https://powerusers.microsoft.com/t5/Building-Flows/is-it-possible-to-replace-multiple-strings-in-one...

 

I also can handle this translation functionality as an independent flow, so I can invoke this funtionality via HTTP from any other flow (providing the string to be converted and the dictionary as inputs), no need to write it everytime I need this feature.

 

What try to do is to implement a loop, taking the dictionary array as the input, then implement an action block to perform the replacement in the string of the current item.

 

It worked fine with two pairs, when I added the third one an arror was displayed.

 

Thank you in advance!



Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



Highlighted
Frequent Visitor

Re: Array variables initialization error

I have the same problem. I know this is an old post but I'm interested if someone can shed some light on it...

Helpful resources

Announcements
Upcoming Events

Experience what’s next for Power Automate

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

Community Conference

Power Platform Community Conference

Find your favorite faces from the community presenting at the Power Platform Community Conference!

FirstImage

Microsoft Ignite 2020

Check out the announcement of Power Platform content at Microsoft Ignite!

firstImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (12,517)