Closed berlioz5 closed 1 year ago
@hongooi73 is there any chance you can take a look at this? I would really appreciate it. you've really done amazing work with this package.
Can you provide a sample of the failing code? What error are you getting?
Hi, below is some code. apologies that its heavily redacted. I am getting an error when trying to use the described get_subsite() method. and honestly, i cant even see that as a method per the output of the call to the main site, so I'm not sure what's going on or if gets_subsite() actually exists.
is there a different way to access the subsite that i'm unaware of? semi-related, @hongooi73, im wondering if you do consulting work. if so what's the best way to get in contact.
Thanks
library(AzureGraph)
library(Microsoft365R)
sp_site <- get_sharepoint_site(site_url = "https://redacted.sharepoint.com/sites/redactedsitename")
sp_site
<Sharepoint site 'redacted Main Hub'>
directory id: redacted.sharepoint.com,redacted
web link: https:/redacted.sharepoint.com/sites/redacted
description: redacted description
---
Methods:
delete, do_operation, get_drive, get_group, get_list, get_list_pager, get_lists, list_drives, list_subsites, sync_fields, update
> f <- sp_site$list_subsites()
> f
[[1]]
<Sharepoint site 'redacted'>
directory id: redacted
web link: https://redacted.sharepoint.com/sites/redacted/redactedsubsite
description: redacted
---
Methods:
delete, do_operation, get_drive, get_group, get_list, get_list_pager, get_lists, list_drives, list_subsites, sync_fields, update
[[2]]
<Sharepoint site 'redacted'>
directory id: redacted
web link: https://redacted.sharepoint.com/sites/redacted/redactedsubsite
description: redacted
---
Methods:
delete, do_operation, get_drive, get_group, get_list, get_list_pager, get_lists, list_drives, list_subsites, sync_fields, update
## attempts at get_subsite
> f <- sp_site$get_subsite("redacted subsite_name")
Error: attempt to apply non-function
Looks like for whatever reason, I forgot to implement get_subsite
. However, you don't actually need it; you can just use the result of list_subsites
. That's just a list of objects representing all the subsites of your site.
sp_site$list_subsites()[[1]] # 1st subsite
sp_site$list_subsites()[[2]] # 2nd subsite
And yes, I'm available for consulting! You can email me at the package maintainer address: hongooi73 (at) gmail.com.
Actually, the reason I didn't implement get_subsite
is because there's no documented API call for this. Instead, try using the regular get_sharepoint_site
function, and pass it the URL for your subsite.
Disclaimer: I don't have access to a business MS365 sub right now, so I can't test this.
thank you! that worked. I might reach out in the next few weeks. I appreciate your help.
Hi - i am trying to access a subsite inside a SharePoint library. after review, I found the below snippet from the OneDrive and SharePoint vignette. however, when I try to use get_subsite() it doesn't seem to be a valid method. does anyone have experience accessing subsites or can someone point me to what i'm doing wrong? i've had no probem accessing sharepoint root sites and drives. just seem to be having this issue with subsites.
vignettes/od_sp.Rmd