I am trying to update some custom metadata of a sharepoint item (additional columns added, not just "name") with this package. I am able to achieve this via the mgc cli with e.g.
mgc sites lists items fields patch --list-id $listID --site-id $siteID --list-item-id 5 --body '{"metadataValue": "123"}'
With AzureGraph, following this workflow:
gr <- get_graph_login()
site <- gr$get_sharepoint_site(sp_url)
lists <- site$get_lists()[[1]]
item <- lists$get_item(5)
item$update("metadataValue" = "123")
the path that is constructed does not include the "fields" path. It appears that the op argument to do_operation() would be where this could/should be set, but this is not exposed to the outer update() function
|
update=function(...) |
|
{ |
|
self$do_operation(body=list(...), encode="json", http_verb="PATCH") |
|
self$properties <- self$do_operation() |
|
self |
|
}, |
...
|
do_operation=function(op="", ...) |
|
{ |
|
op <- construct_path(private$api_type, self$properties$id, op) |
|
call_graph_endpoint(self$token, op, ...) |
|
}, |
Could this be modified to update(op="", ...) (or some other equivalent approach)? It is difficult to inject this since the class is R6, but my workaround for the moment is
field_update <- function(obj, ...) {
obj$do_operation(op = "fields", body = list(...), encode = "json", http_verb = "PATCH")
}
field_update(item, "metadataValue" = "123")
I am trying to update some custom metadata of a sharepoint item (additional columns added, not just
"name") with this package. I am able to achieve this via themgccli with e.g.With
AzureGraph, following this workflow:the
paththat is constructed does not include the"fields"path. It appears that theopargument todo_operation()would be where this could/should be set, but this is not exposed to the outerupdate()functionAzureGraph/R/ms_object.R
Lines 81 to 86 in 983aaaa
...
AzureGraph/R/ms_object.R
Lines 113 to 117 in 983aaaa
Could this be modified to
update(op="", ...)(or some other equivalent approach)? It is difficult to inject this since the class is R6, but my workaround for the moment is