Azure / Azure/Microsoft365R

Recursive List Items

Open
#108 8 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
R
Stars
368
Forks
58
Avg merge
1h 42m
Merged PRs (30d)
4

Description

Is there a way for list_items() to work recursively in directories? If not, this feature would be very handy to have.

First, to make sure I'm not misunderstanding how to use the package, I can run all of the following commands successfully:
```
site <- get_sharepoint_site(
site_url = "https://[our subdomain].sharepoint.com"
)

drv <- site$get_drive()

drv$list_items()

drv$list_items(filter = "name eq '[name of some folder at top level of hierarchy]'")

```

But when i try to use filter with a name in one of the subfolders, doesn't seem to get results.
```
drv$list_items(filter = "name eq '[name of file in a subfolder with extension]'")
# [1] name size isdir id
# <0 rows> (or 0-length row.names)
```
I've seen that there are some ways to do recursive operations by looking up child directories in for loops, but that seems like a non-starter for the volume of directories I need to iterate over, each of which with their own folder hierarchy.

My overall goal is to replicate something like the search feature on Sharepoint--I need to return a dataframe of document metadata for documents with a specific name scattered throughout our Sharepoint site.

Contributor guide

Open the contributing guide

Research direction

Start by reviewing the existing list_items() behavior and how Microsoft Graph exposes SharePoint drive-item listing or search. The issue's goal is a dataframe of document metadata matching a name across nested folders; done should mean matching files can be returned without manually traversing each directory.

Written by the indexing model from the issue text.

Assessment

Tech stack
r
Domain
api, cloud
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.