Forum Discussion
Working with Sharepoint List Data
Hello parry2k Thank you for taking time out to respond. No this is not coming while merging the data , the moment i import sharepoint list data i see this o_data being prefixed to all columns and also few of my column names are shportened.
Hi priyaa ,
Please try this:
I'll presume you have already brought in your SharePoint List into Power Query.
Create a new query called RealNames using the OData connector and the Odata query as I defined before. This will bring you a table with columns InternalName and Title (aka RealName). Transform this into a list or records, then the records into lists. The items in this final list become the name-value pairs for your rename operation.
let
Source = OData.Feed("https://xxx.sharepoint.com/sites/your site/_api/web/lists/GetByTitle('your list')/Fields?$select=Title,InternalName", null, [Implementation="2.0"]),
recs = Table.ToRecords(Source),
lsts = List.Transform(recs, each Record.ToList(_))
in
lsts
Then back in your query where you brought in the SharePoint list, append this line:
= Table.RenameColumns(#"your previous step name", RealNames, MissingField.Ignore)
This will replace the names of any column whose internal name matches and ignore the others.
Reference: How to retrieve "correct" column names from SharePoint lists.
Best Regards,
Icey
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.