User Profile
imbourg
Copper Contributor
Joined Nov 28, 2018
User Widgets
Recent Discussions
SPO REST API: How to retrieve items in a List folder
Hi, This seems crazy but I can't seem to figure out how to retrieve Items in a List folder with REST. As you know, SP Lists can have folders, but how to retrieve Items in a specific List folder. Say I have this conf: ListX -FolderA --Item1 --Item2 -FolderB --Item3 --Item4 How do I retrieve Item1 & Item2 knowing FolderA? The question has been asked a lot on stackoverflow, answers are there but nothing seem to work... MS really needs to provide good documentation for SPO. This is beyond frustrating. I have tried: _api/Web/GetFolderByServerRelativePath(decodedurl='/sites/somesite/Lists/ListX/FolderA')/Items _api/Web/GetFolderByServerRelativePath(decodedurl='/sites/somesite/Lists/ListX/FolderA')?$expand=Folders,Files,Items _api/Web/GetFolderByServerRelativePath(decodedurl='/sites/somesite/Lists/ListX/FolderA')/ListItemAllFields You can replace GetFolderByServerRelativePath with GetFolderByServerRelativeUrl as well, I tried all with many others... None is working. Does anyone know what works with SPO (SharePoint Online)?1.6KViews0likes0CommentsRe: SharePoint REST API: How to retrieve all folders in a list?
Thank you Joel Rodrigues I also found this: /_api/web/lists/GetById('${ListID}')/Items?$filter=FSObjType eq 1 But the problem is that just like yours, the response does not give the folders' names. Then I found: /_api/web/lists/GetById('${ListID}')/rootFolder/Folders It gives the folders' name but curiously it finds an additional folder named Item :( Even with a list without folders, it will list that weird folder... Thanks very much54KViews0likes3CommentsSharePoint REST API: How to retrieve all folders in a list?
Hello All, Does SharePoint allow to retrieve all folders in a List? (Not a Doc Library). Just a basic List. I am using SharePoint Online. I tried /_api/web/lists/GetById('${ListID}')/Folders without luck. And please can someone share a link to a comprehensive SPO Lists & Doc Lib REST API reference? I only have this https://msdn.microsoft.com/en-us/library/office/jj860569.aspx#Reference . Is it not outdated?Solved56KViews0likes5CommentsRe: How to add custom CSS when building SPFx web part
Thanks Joel for this. It can guide me in the right direction... However I can be more explicit about what I wanted to do: I load items from a SP List (REST): depending on the value of a field called status, I apply different style via CSS classes to the rendering of the item. And there are many statuses. So I created a javascript object that matches the status value with corresponding CSS class called _statusstyle Now when it comes to generate the HTML, I do the following (in a loop over the list item). <div class="${ styles.listItem } ${ _statusstyle[status]}"> This will automatically apply the corresponding CSS class to the div e.g. pending but the problem is that SP will generate something like pending_3c48f1c2. Do you see the dilemma now? Is there a way to do something like ${ styles._statusstyle[status]} An alternative will be using if or switch statement but it will be too long...11KViews0likes3CommentsHow to add custom CSS when building SPFx web part
Currently I add my custom CSS style to the NameWebPart.module.scss but when generated Sharepoint appends a random suffix to the class I created. For example a class .circle could render as .circle_3c48f1c2. I assign CSS class to nodes programmatically. However this suffix makes it impossible to get my design to render correctly. Any solution to having my own custom css without the _suffix ? Or at least a way to predict the css class that will be generated in Javascript?Solved12KViews0likes5Comments
Recent Blog Articles
No content to show