0

I wanted to update Project Department Ent Custom Field value, which is of type look-up field- ... from a csv file via/using powershell /csom. Many projects have department field to be updated/modified & I am looking to do this by some powershell script.

But I have no luck to push Dept value from csv into project server Field (Project Department)

[Array]$MyArray1 = $_.Dept
$draftProject.SetCustomFieldValue($Dept,$MyArray1)

Ref - https://gallery.technet.microsoft.com/projectserver/Update-Server-Custom-Field-00ab99a9

Appreciate any idea ... Thanks

wp78de
  • 18,207
  • 7
  • 43
  • 71
MAF
  • 3
  • 2

2 Answers2

0

The Q & A section of the referenced TechNet gallery project contains a similar question and the author himself answers:

For lookup fields (Either multi-select or not), you can only pass the Lookup value as an array (The array value must be the MemberValue GUID from the Lookup table in DB.

This should do the trick.

wp78de
  • 18,207
  • 7
  • 43
  • 71
0

go to pwaurl/pwa/_api/ProjectServer/CustomFields then search for Project Department You are looking for its internalName usually like: custom_Guid.

Project department needs to be passed as an array, with text values replaced with their guid

  • Thanks Yusuff, it worked when I used the GUID of look up value of Department subitem. – MAF Nov 14 '20 at 15:45