Forum Discussion

ottiphi's avatar
ottiphi
Helper I
8 years ago

Expression.Error: We cannot convert a value of type List to type Text.

Hello all,

 

Please see the Scrrenshot. I have a column named "Hashtag". Each cell is automatically getting data from sharepoint. the user has in sharepoint the option to tick Checkboxes (allow multiple selections). I now need the cells to be text cells. How can I transform the List within each cell into text (hashtags devided with ","  ?)

 

Thank you so much for your help!

 

7 Replies

    • ottiphi's avatar
      ottiphi
      Helper I

      Hello. I already had that idea. Can you specify a little bit more and maybe write a lign of code that I could use? I am not a coder! Also, where exactly should I insert the function?

      • Greg_Deckler's avatar
        Greg_Deckler
        Community Champion

        You should be able to put it whereever in your query, open up Advanced Editor and add a line. Here is an example function I wrote that you can take a look at:

         

        let
            fnCombine = () =>
         
        let
         
        values = {
         
        "0",
        "1",
        "2",
        "3",
        "4",
        "5",
        "6",
        "7",
        "8",
        "9",
        "A",
        "B",
        "C",
        "D",
        "E",
        "F"
        
        },
        
        Result = Text.Combine(values,",")
        
        in
        
        Result
        
        in
        
        fnCombine

        Also, here it is as a generic function that you should be able to use. Just add a Blank Query, paste in the code below, save function. Add Column -> Invoke Custom Function and send it your column that is a list as its parameter.

         

        let
            fnCombine = (values as list) =>
         
        let
        
        Result = Text.Combine(values,",")
        
        in
        
        Result
        
        in
        
        fnCombine