Azure / Microsoft365R

R SDK for interacting with Microsoft 365 APIs
Other
313 stars 44 forks source link

Question/Feature Request: download SharePoint List attachment #53

Open leungi opened 3 years ago

leungi commented 3 years ago

Scenario: user adds a record in SharePoint List and upload files as attachment.

Goal: be able to download attachments into an R session.

Current State

Able to show that attachments exist, but no method to list attachments' URL or download them.

SharePoint attachments don't seem to be stored in any of the drives either, so can't get from there.

my_site <- Microsoft365R::sharepoint_site(
  site_url = config::get("sp_site"),
  app = AzureGraph:::.az_cli_app_id
)

data_raw <- my_site$get_list("List")$list_items()

data_raw %>%
  select(id, Attachments)

# _List_ showing attachments
#>   id Attachments
#> 1  7       FALSE
#> 2  8        TRUE

# _List_ folder showing empty even though it has attachments
my_site$get_drive()$list_files()
                     name     size isdir
1                 General 16643828  TRUE
2                    List        0  TRUE
3           Weekly Report 12600039  TRUE
4            Untitled.png     8835 FALSE
hongooi73 commented 3 years ago

This isn't yet possible with the Graph API. I'll look into it when this changes.