Forum Discussion

LsL's avatar
LsL
Regular Visitor
1 year ago

Combining Multiple Values from a SharePoint List into a Single Cell in Dataverse Using Power Query a

I have an online SharePoint list that I want to import into a Dataverse table using a dataflow. The SharePoint list contains a column with multiple values (list or table type) that I need to expand. However, instead of expanding these values into multiple rows, I want to combine them into a single cell, separated by comma

7 Replies

  • v-kpoloju-msft's avatar
    v-kpoloju-msft
    Community Support

    Hi LsL,

    Thank you for reaching out to the Microsoft fabric community forum. Thank you nilendraFabric, for your inputs on this issue.

    I understand you are working with a SharePoint Online list and using a dataflow to import it into a Dataverse table. You have a column containing multiple values (such as a people picker or multi-select choice field), and you want to combine these values into a single cell separated by commas instead of expanding them into separate rows.

    This is a common scenario when handling list or table-type columns in Power Query. Here’s how you can accomplish this in your dataflow using Power Query:

    Combine Multiple Values into a Single Cell: Connect your SharePoint list in the Power Query editor. Identify the multi-value column (e.g., Assigned to). Add a Custom Column with the following formula:

    Text.Combine(List.Transform([AssignedTo], each Record.Field(_, "DisplayName")), ", ")

    This line extracts the display name from each item in the list and combines them into a single comma-separated string. If your multi-value column has a different name or contains different fields, update "display name" accordingly.

    Remove the original multi-value column if it is no longer needed and rename your new custom column to align with your schema. Ensure your final output contains only flat columns (text, number, date) to ensure compatibility with Dataverse.

    After completing these steps, save and refresh the dataflow. This will ensure each SharePoint list item remains in a single row, with the combined multi-value field in one cell as intended.

     

    Kindly refer to the below following links for more information:
    Text. Combine - Power Query M | Microsoft Learn
    List. Transform - Power Query M | Microsoft Learn

    If this post helps, then please give us ‘Kudos’ and consider Accept it as a solution to help the other members find it more quickly.

    Thank you for using Microsoft Community Forum.

    • v-kpoloju-msft's avatar
      v-kpoloju-msft
      Community Support

      Hi LsL,

       

      May I ask if you have resolved this issue? If so, please mark the helpful reply and accept it as the solution. This will be helpful for other community members who have similar problems to solve it faster.

      Thank you.

      • v-kpoloju-msft's avatar
        v-kpoloju-msft
        Community Support

        Hi LsL,

        I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions. If my response has addressed your query, please accept it as a solution and give a 'Kudos' so other members can easily find it.
        Thank you.

  • Shahid12523's avatar
    Shahid12523
    Community Champion

    You can do this in Power Query before loading to Dataverse.

     

    Steps:

    In your dataflow, load the SharePoint list.

    The multi-value column will appear as a table/list.

    Use Transform → Extract Values on that column.

    Choose a separator (, or ;).

    Power Query will flatten the list into a single text string in the cell.

    Load to Dataverse — now you’ll get one row with combined values instead of multiple rows.

     

    So instead of expanding into rows, you extract values with a delimiter.

  • Hello LsL 

     

    Ensure that the multi-value column is in text format. Use transformations like `Text.Clean` or `Text.Trim` if necessary

     

    Use the Group By function from the Power Query

    Edit the M Code generated by Group By to combine values using `Text.Combine`:

    Table.Group(#"PreviousStep", {"ID"}, {{"CombinedValues", each Text.Combine([MultiValueColumn], ","), type text}})

     

  • LsL's avatar
    LsL
    Regular Visitor

    Can this approach achieve expanding a table column in SharePoint Online list using Power Query without creating multiple rows with the same ID, and instead combine the values into a single string?