phpSPO icon indicating copy to clipboard operation
phpSPO copied to clipboard

Add a listitem of Users or People as metadata

Open VicreaGIJ opened this issue 6 years ago • 0 comments

estoy tratando subir un archivo en sharepoint y asignarle una metadata. El archivo sube con normalidad pero cuando intengo agregarle la propiedad del tipo "Persona o Grupo" llama empleados en donde me piden agregar un valor de SP.Listitem

$ctx = $targetList->getContext();

$fileCreationInformation = new \Office365\PHP\Client\SharePoint\FileCreationInformation();
$fileCreationInformation->Content = file_get_contents($filename);
$fileCreationInformation->Url = basename($filename);


$uploadFile = $targetList->getRootFolder()->getFiles()->add($fileCreationInformation);
$ctx->executeQuery();
print "File {$uploadFile->getProperty('Name')} has been uploaded\r\n";

$uploadFile->getListItemAllFields()->setProperty('Title', basename($filename));
$uploadFile->getListItemAllFields()->setProperty('Mes', 1);
//$uploadFile->getListItemAllFields()->setProperty('Personal', ?????);
$uploadFile->getListItemAllFields()->update();
$ctx->executeQuery();
imagen

VicreaGIJ avatar Apr 19 '18 20:04 VicreaGIJ