Convert Array Dictionaries (strings) To List Diuctionaries (string)

Hello Good Morning. I am trying to change the format of an Array of dictionaries to a List of dictionaries. Does anyone know the olgo formula to do it? Thank you very much!

Hey!

You convert the array to list. Follow the steps:

  1. Create a new list variable
  2. Take one assign activity and do this
newList = myArray.ToList

That’s it.

Reference:

Regards,
NaNi

Hi @Jaime_Diaz_Puchol

To convert an array of dictionaries to a list of dictionaries in UiPath, you can use the following approach:

  1. Create a new List of Dictionaries variable: Define a new variable of type List<Dictionary<string, object>> to store the converted data. Let’s call it listOfDictionaries.
  2. Initialize the List variable: Assign an empty list to the listOfDictionaries variable using the “Assign” activity. Set its initial value as New List(Of Dictionary(Of String, Object))().
  3. Loop through the Array of Dictionaries: Use a “For Each” activity to iterate over each element in the array. Let’s call the current element dictionary within the loop.
  4. Add Dictionary to List: Inside the loop, use the “Add To Collection” activity to add the dictionary variable to the listOfDictionaries variable.a. Set the “Collection” property of the “Add To Collection” activity as listOfDictionaries.b. Set the “Item” property as dictionary.
  5. After the loop, the listOfDictionaries variable will contain the converted data in the desired format.

Thanks!!