cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
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!





If anyone is trying to help you with an issue, the fastest way to say thanks is by kudoing. Be grateful, Thumbs up!

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!





If anyone is trying to help you with an issue, the fastest way to say thanks is by kudoing. Be grateful, Thumbs up!

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

Power Platform Online Conference

Speakers, submit your sessions now! Call for speakers ends Feb. 10!

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!

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Solution Authors
Top Kudoed Authors (Last 30 Days)
Users online (4,699)