microsoftgraph / microsoftgraph/msgraph-sdk-php

Support Excel Workbook Table Add TableRowCollection

Aperta
#1,497 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Lingua principale
PHP
Stelle
669
Fork
150
Merge medio
15h 21m
PR unite (30g)
3

Descrizione

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.

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Inizia dal punto di ingresso generato AddPostRequestBody::setValues() nel percorso Drives/Workbook/Tables/Rows/Add e confronta l’implementazione PHP con l’issue collegata del .NET SDK e il branch dev. Verifica l’esempio documentato tablerowcollection-add e il comportamento risultante della richiesta; il lavoro è completato quando l’aggiunta di righe alle tabelle Excel funziona senza gli errori di tipo o OData segnalati.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
php
Ambito
api
Tipo di issue
Funzionalità
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.