0

I have a major requirement from my manager and this needs to be fulfilled as early as possible.

Requirement: There is a List A and List B. List A acts as a database from which data has to be fetched into List B.

Now List A has three Columns :

  1. Business Unit(BU)(Dropdown)
  2. Project Name(Textfield)
  3. Should Cost Modeler(People Picker Field)

Now, i want to get all my projects based on Business Unit and then when i select a particular project it should fetch employee name in regard to the project.

Example : If in List B i select a Bu : Xyz , then all the projects pertaining to the BU should pop up and then as soon as i select project name, the should cost modeler name should be in dropdown.

How do i fulfill this requirement. As it is a very tricky one and i am not so good in Rest API.

Thanks

0

To filter based on BU, sample rest api /_api/web/lists/getbytitle('ProjectMaster')/items?$filter=Business_x0020_Unit eq 'HR'

Select user name and filter based on Project Name /_api/web/lists/getbytitle('ProjectMaster')/items?$select=Should_x0020_Cost_x0020_Modeler/Title&$expand=Should_x0020_Cost_x0020_Modeler&$filter=Project_x0020_Name eq 'p1'

Common Dropdown operation

0

To Get All Bussiness Unit from Choice column(Dropdown) use this ajax call.

$.ajax({

    url: "host url"+"_api/web/lists/GetByTitle('List Name')/fields?$filter=EntityPropertyName eq 'Choice Field Name'",

    type: "GET",

    headers: {

        "accept": "application/json;odata=verbose",

    },

    success: function (data) {

        console.log(data.d.results[0].Choices.results);

    },

    error: function (error) {

        alert(JSON.stringify(error));

    }

});

then use rest API suggested by @Lee_MSFT.

To filter based on BU, sample rest api /_api/web/lists/getbytitle('ProjectMaster')/items?$filter=Business_x0020_Unit eq 'HR'

Select user name and filter based on Project Name /_api/web/lists/getbytitle('ProjectMaster')/items?$select=Should_x0020_Cost_x0020_Modeler/Title&$expand=Should_x0020_Cost_x0020_Modeler&$filter=Project_x0020_Name eq 'p1'

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.