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!
To convert an array of dictionaries to a list of dictionaries in UiPath, you can use the following approach:
- 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 itlistOfDictionaries. - Initialize the List variable: Assign an empty list to the
listOfDictionariesvariable using the “Assign” activity. Set its initial value asNew List(Of Dictionary(Of String, Object))(). - 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
dictionarywithin the loop. - Add Dictionary to List: Inside the loop, use the “Add To Collection” activity to add the
dictionaryvariable to thelistOfDictionariesvariable.a. Set the “Collection” property of the “Add To Collection” activity aslistOfDictionaries.b. Set the “Item” property asdictionary. - After the loop, the
listOfDictionariesvariable will contain the converted data in the desired format.
Thanks!!
