Forum Discussion
Imported data from multiple SharePoint lists not coming through under the same column
- 4 years ago
I agree with what Ehren has said. The thing to watch out for with SharePoint lists, what the columns are visually named as are not neccessarily what they are called in the background.
If you know the number of columns, you could define the new column names and rename all of the columns dynamically.
Example, paste these into two separate queries to see what I mean. Alternately, attached PBIX file for your convenience.
// Columns let Source = Table.FromRows( Json.Document( Binary.Decompress( Binary.FromText("i45Wcs4vzSspqlSK1YlWCijKTylNLgGzgxNzUouVYmMB", BinaryEncoding.Base64), Compression.Deflate ) ), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [NewColumns = _t] ), #"Changed Type" = Table.TransformColumnTypes(Source, {{"NewColumns", type text}}) in #"Changed Type"// Table let Source = Table.FromRows( Json.Document( Binary.Decompress( Binary.FromText( "i45Wck7MS0xJVNIBMoqKUktSi0BsYyNjcwOlWJ1oJbeixLzkVAxpM6g0XLdvfl4JkA2SNDAyNMMpaWxsaGGuZwqW902tyEzOR5E3sjA3MQAaHQsA", BinaryEncoding.Base64 ), Compression.Deflate ) ), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [C = _t, P = _t, S = _t] ), #"Changed Type" = Table.TransformColumnTypes( Source, {{"C", type text}, {"P", type text}, {"S", type number}} ), OldColumns = List.Buffer(Table.ColumnNames(#"Changed Type")), NewColumns = List.Buffer(Table.ToList(Columns)), RenameList = List.Buffer(List.Zip({OldColumns, NewColumns})), Rename = Table.RenameColumns(#"Changed Type", RenameList, MissingField.Ignore) in Rename
Issue #2 is likely caused by issue #1. You probably need to either fix the naming inconsistencies at the source (SharePoint), or add a set of conditional rename operations (for example, if the table has column "ListID#", then rename it to "List ID#").
EDIT: Also, how are you combining the SP lists (merge/join or combine/append)?