none
Access Lookup Table for local custom field on Project Server? RRS feed

  • Question

  • Scenario: a user has an .mpp project file they work with locally. They set up a local custom text field to use a lookup table. They then upload and save that file to a Project Server / PWA instance, and publish it.

    Is there a way to access the lookup table for that field using the /_api/ProjectServer/ REST endpoint?

    I know already that I can see the values of local custom fields by getting tasks from

    /_api/ProjectServer/Projects('project-id')/Tasks

    and the local custom fields show up with internal names like

    LocalCustom_x005f_Published_x005f_7c0ccd0ceb0aea1182667c7635fa5766_x005f_000039b78bbe4ceb82c4fa8c0b40003b

    however, the value of a local custom text field that has been set up to use a lookup table is not a string of the display value of that lookup entry, it's an array with the internal name of the lookup table entry, so something like

    ["Entry_10fb560fc5c0e711a8f0e4a7a071ef48"]

    So, clearly, if I can get a hold of the lookup table entries, I can find the entry by its internal name and get the display value. However, if I try to get the lookup tables from

    /_api/ProjectServer/LookupTables

    I only get the Enterprise lookup tables.

    So is there a way to get the lookup table associated with a local custom field in a project that has been uploaded to Project Server?


    Dylan Cristy | MCSA: Web Applications

    Wednesday, November 20, 2019 7:01 PM

Answers

  • Hi Dylan,

    Yes you can access the local custom field's lookup table with entries. Follow the below REST URL and change the Project id, local custom field internal name.

    https://<<PWA URL>>/_api/ProjectServer/Projects('<<ProjectID>>')/CustomFields('LocalCustom_Draft_f233fada2a0cea119bdad4258bf6958b_000039b78bbe4ceb82c4fa8c0b400033')/LookupTable/Entries

    If you are unsure about the local custom field internal name, then break the URL  till "Customfields" and put this in IE/Chrom browser, so you will get the internal name, find it and update. You will get the complete lookup table with entries. Its a working URL as I have tested in my local.


    Rajkumar Allepu (MCP) , | https://sharepointprojectserver.com ** Please mark it as answer if my answer would resolved your issue.

    • Marked as answer by Dylan Cristy Thursday, November 21, 2019 3:11 PM
    Thursday, November 21, 2019 7:24 AM

All replies

  • Hi Dylan,

    Yes you can access the local custom field's lookup table with entries. Follow the below REST URL and change the Project id, local custom field internal name.

    https://<<PWA URL>>/_api/ProjectServer/Projects('<<ProjectID>>')/CustomFields('LocalCustom_Draft_f233fada2a0cea119bdad4258bf6958b_000039b78bbe4ceb82c4fa8c0b400033')/LookupTable/Entries

    If you are unsure about the local custom field internal name, then break the URL  till "Customfields" and put this in IE/Chrom browser, so you will get the internal name, find it and update. You will get the complete lookup table with entries. Its a working URL as I have tested in my local.


    Rajkumar Allepu (MCP) , | https://sharepointprojectserver.com ** Please mark it as answer if my answer would resolved your issue.

    • Marked as answer by Dylan Cristy Thursday, November 21, 2019 3:11 PM
    Thursday, November 21, 2019 7:24 AM
  • Thank you, this worked!  In addition, something you may find interesting - as I was playing around with this in Postman to see if it would work, I discovered that you don't even need that long name for the custom field, you just need the field's GUID, so in the example you gave:
    https://<<PWA URL>>/_api/ProjectServer/Projects('<<ProjectID>>')/CustomFields('000039b78bbe4ceb82c4fa8c0b400033')/LookupTable/Entries



    Dylan Cristy | MCSA: Web Applications

    Thursday, November 21, 2019 3:11 PM