Skip to content

Instantly share code, notes, and snippets.

@ImkeF
Last active October 16, 2020 08:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ImkeF/fb2f8892d8741a27d8a72d5ab2894b25 to your computer and use it in GitHub Desktop.
Save ImkeF/fb2f8892d8741a27d8a72d5ab2894b25 to your computer and use it in GitHub Desktop.
Removes unnecessary columns from SharePoint List imports.
let func =
(SourceTable as table) => Table.RemoveColumns(
    SourceTable, 
    {
      "FileSystemObjectType", 
      "ServerRedirectedEmbedUri", 
      "ServerRedirectedEmbedUrl", 
      "ComplianceAssetId", 
      "OData__UIVersionString", 
      "GUID", 
      "FirstUniqueAncestorSecurableObject", 
      "RoleAssignments", 
      "AttachmentFiles", 
      "ContentType", 
      "GetDlpPolicyTip", 
      "FieldValuesAsHtml", 
      "FieldValuesAsText", 
      "FieldValuesForEdit", 
      "File", 
      "Folder", 
"Created",
      "LikedByInformation", 
      "ParentList", 
      "Properties", 
      "Versions", 
      "Author", 
      "Editor", 
      "ContentTypeId"
    }, MissingField.Ignore
  ) ,
documentation = [
Documentation.Name = " Table.RemoveSPListColumns.pq ",
Documentation.Description = " Removes unnecessary columns from Sharepoint List imports. ",
Documentation.LongDescription = " Removes unnecessary columns from Sharepoint List imports. Easily customizable with row-wise commenting. ",
Documentation.Category = " Table.ColumnOperations ",
Documentation.Source = " ",
Documentation.Version = " 1.0 ",
Documentation.Author = " Imke Feldmann ",
Documentation.Examples = {[Description = " ",
Code = " ",
Result = " "]}]
in
Value.ReplaceType(func, Value.ReplaceMetadata(Value.Type(func), documentation))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment