Support Excel Workbook Table Add TableRowCollection

未关闭
#1,497 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
35/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
停滞
技术栈
php
领域
api

调研方向

从 Drives/Workbook/Tables/Rows/Add 路径下生成的 AddPostRequestBody::setValues() 入口点开始,并将 PHP 实现与链接的 .NET SDK issue 和 dev 分支进行比较。验证文档中的 tablerowcollection-add 示例以及由此产生的请求行为;完成标准是添加 Excel 表格行时不会出现报告中的类型或 OData 错误。

由索引模型根据 Issue 内容生成。

描述

Basically, same issue as described in the dotnet sdk, raising here to save others from wasting an entire day on this as I have.

https://github.com/microsoftgraph/msgraph-sdk-dotnet/issues/1928

This issue exists in msgraph-sdk-php in dev branch.

The documentation is wrong as well for PHP at https://learn.microsoft.com/en-us/graph/api/tablerowcollection-add?view=graph-rest-1.0&tabs=php :

<?php

$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);

$requestBody = new AddPostRequestBody();
$requestBody->setIndex(5);
$requestBody->setValues([	[1,2,3],	[4,5,6],	]);

$result = $graphServiceClient->drives()->byDriveId('drive-id')->items()->byDriveItemId('driveItem-id')->workbook()->tables()->byWorkbookTableId('workbookTable-id')->rows()->add()->post($requestBody)->wait();

However, this will request in an error on the setValues() call saying it expects a Json object:
Fatal error: Uncaught TypeError: Microsoft\Graph\Generated\Drives\Item\Items\Item\Workbook\Tables\Item\Rows\Add\AddPostRequestBody::setValues(): Argument #1 ($value) must be of type ?Microsoft\Graph\Generated\Models\Json, array given,

Constructing a Json object using that class will instead result in an Odata error when making the actual request

Fatal error: Uncaught Microsoft\Graph\Generated\Models\ODataErrors\ODataError in vendor/microsoft/microsoft-graph/src/Generated/Models/ODataErrors/ODataError.php:36

Hoping this feature will get support added as well as hoping by surfacing this here others can find it in the search and know that adding table rows in Excel is not currently working with this SDK.

主要语言
PHP
星标
669
派生
149
平均合并
1 天 4 小时
30 天内合并 PR
5

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

microsoftgraph/msgraph-sdk-php 的其他 Issue

查看 microsoftgraph/msgraph-sdk-php 的全部 Issue

相似的 Issue

更多 PHP Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。