List.TransformMany
The function returns a list that contains elements projected from the input list. The collectionTransform function changes each element into an intermediate list, and the resultTransform function take...
List.TransformMany(list as list, collectionTransform as function, resultTransform as function) as list
The function returns a list that contains elements projected from the input list. The collectionTransform function changes each element into an intermediate list, and the resultTransform function takes the original element and an item from the intermediate list to create the final result. The collectionTransform function is defined as (x as any) as list => ..., where x represents an element in the list. The resultTransform function defines the shape of the result and has the signature (x as any, y as any) as any => ..., where x represents an element in the list and y represents an element from the list generated by applying x to collectionTransform.
Transform a data list containing people and their pets using Power Query. Apply the MList.TransformMany function to flatten the list. The function takes input like Name and Pets for each person (e.g. Alice with pets Scruffy and Sam, Bob with pet Walker) and outputs a flattened list where each person is matched with their individual pet. The final output will show each person with their corresponding pet, such as Alice with Scruffy, Alice with Sam, and Bob with Walker.