Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
kannanAhammed
Helper IV
Helper IV

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.

1 ACCEPTED SOLUTION
nandukrishnavs
Super User
Super User

@kannanAhammed 

Use the OData connector and use the below parameter.

<site url>/_api/web/lists/getbytitle('List Name')/Items?$select=ID,Column1,Column2

 

http://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
🙂


Regards,
Nandu Krishna

View solution in original post

5 REPLIES 5
nandukrishnavs
Super User
Super User

@kannanAhammed 

Use the OData connector and use the below parameter.

<site url>/_api/web/lists/getbytitle('List Name')/Items?$select=ID,Column1,Column2

 

http://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
🙂


Regards,
Nandu Krishna

@nandukrishnavs 

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.

kannanAhammed_0-1596632152310.png

 

@kannanAhammed 

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-...



Did I answer your question? Mark my post as a solution!
Appreciate with a kudos
🙂


Regards,
Nandu Krishna

amitchandak
Super User
Super User

@kannanAhammed ,

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.

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

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.