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

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
Leo09
Level 8

Re: Array variables initialization error

May I know what are you trying to do?

Dual Super User
Dual Super User

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!



denisb
Level: Powered On

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
firstImage

Better Together Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

firstImage

Incoming: New and improved badges!

Look out for new contribution recognition badges coming SOON!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Community Summit North America

The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (5,174)