Forum Discussion

audian_ben's avatar
audian_ben
Frequent Visitor
1 year ago
Solved

Find and replace the GUID's in a column of lists from another table

Hey all,   I have a case where I my Bingfoo and Googlefoo is failing me.  I have 2 tables that I am trying to rectify.  The first is a list of users and it has a column of lists that contain a numb...
  • AlienSx's avatar
    1 year ago
    let
        user_list = Excel.CurrentWorkbook(){[Name="user_list"]}[Content], 
        guid_table = Function.Invoke(
            Record.FromList, 
            List.Reverse(Table.ToColumns(Excel.CurrentWorkbook(){[Name="guid_table"]}[Content]))
        ), 
        result = Table.TransformColumns(
            user_list, 
            {"guid", (x) => Text.Combine(
                List.Transform(
                    Text.Split(x, ", "), 
                    (w) => Record.FieldOrDefault(guid_table, w, w)
                ), 
                ", "
            )}
        )
    in
        result