Forum Discussion
How to selectively return columns from SharePoint
Hi,
Normally i would use sharepoint online list options to from "Get Data" option to return data. Using the below options
https://community.powerbi.com/t5/Service/Power-BI-Get-Data-From-SharePoint-List-Library/td-p/280109
Something like "Select columnA, ColumnB from listName"
But this would return all the fields from sharepoint, I want only a select few columns from the sharepoint list. How do i do this?
I know I can remove the columns at the transformation stage. But i cant do this on this case due to some errors in the sharepoint list.
any help will be appreciated.
Anonymous
Use the OData connector and use the below parameter.
<site url>/_api/web/lists/getbytitle('List Name')/Items?$select=ID,Column1,Column2http://michaelsoriano.com/understanding-sharepoint-rest-api-part-1-selecting-items/
Did I answer your question? Mark my post as a solution!
Appreciate with a kudos 🙂
5 Replies
- nandukrishnavsCommunity Champion
Anonymous
Use the OData connector and use the below parameter.
<site url>/_api/web/lists/getbytitle('List Name')/Items?$select=ID,Column1,Column2http://michaelsoriano.com/understanding-sharepoint-rest-api-part-1-selecting-items/
Did I answer your question? Mark my post as a solution!
Appreciate with a kudos 🙂- AnonymousNot applicable
Thanks Nandukrishnavas, it worked on text column but when i tried it with people or groups, choice and lookup column. it throws the below error.
- nandukrishnavsCommunity Champion
Anonymous
You have to add expand parameter.
Refer to this : https://sharepointeducation.wordpress.com/2016/07/19/getting-person-or-group-type-field-in-rest-api-sharepoint-2013/
Did I answer your question? Mark my post as a solution!
Appreciate with a kudos 🙂
- amitchandakSuper User
Anonymous ,
See if this can work. I have not tested it.
open data transform/edit query mode. Right click on the table and open advance editor. If it shows a list of the column , you can reduce it from the list and try.
- AnonymousNot applicable
I will not be able to go to that stage if transformation, the list already throwing an error while connecting due to issues in the column.
It needs to be from the connection stage itself