none
Accessing Lookup Table values with CSOM in Project server online RRS feed

  • Question

  • I am trying to get values from Lookup Table which is used in Projects PDP forms .I need to fetch that data and need to bind on html control.

    I am using Project server online.

    Guide me how to query Lookup Table.


    Amey Pusalkar


    Wednesday, January 6, 2016 12:39 PM

All replies

  • I had resolved this Query ,sharing a code with u all.

    To fetch a Lookup field value its important to find GUID of lookup table.After that you can make REST call to the lookup table and then you simply bind your values to html control.

    function GetCRPriorityLookup() {
        $.ajax({
            url: "https://yoursite/sites/PMO/_api/ProjectServer/LookupTables('" +Lookup GUID+ "')/Entries",
            type: "GET",
            headers: { "Accept": "application/json; odata=verbose" },
            //   datatype: "json",
            success: function (response) {

              var Lookupvalues = "<option value=" + '"' + '"' + ">Select</option>";

                for (i = 0; i < response.d.results.length; i++) {

                    Lookupvalues = Lookupvalues + '<option value=' + '"' + response.d.results[i]["Id"] + '"' + '>' +                                response.d.results[i]["FullValue"] + '</option>';

                }
    //bind to dropdown
                $('#System1').append(Lookupvalues);
            },
            failure: function (response) {
                alert(response.d);
            },
            error: function (error) {
                alert(error.d);
            }
        });
    }


    Amey Pusalkar


    Friday, November 4, 2016 9:59 AM