0

I have a list "List1" having following fields

Department : Single line of text

HOD : Person or group(Multiple values)

There is another list called "List2" with following fields

FacultyName : Single line of text

Dept : Lookup ("Department" column of "List1")

HOD : Person or Group(Multiple values)

My query is how to auto-populate HOD field in "List2" based on the "Dept" lookup selection.

It should fetch values from corresponding HOD field of "List1".

Here the HOD fields have multiple values. I have the solution for fetching single "Person or group" value, but I need the solution for fetching Multiple values.

I am using SharePoint online.

Please help me out here. Thanks in advance.

0

AS you will have already discovered the option to display a multi-person field does not appear when you are specifying a lookup field in List2. The only way I can see you achieving this is via a workflow using Sharepoint Designer. This would be triggered when you create or modify a record in List2.

Steps

  • Create List1 as you have done already
  • In List 2 create a field called HOD. Specify this as a Person or Group and allow multiple values. We are going to populate this in the workflow.
  • The next steps assume you have Sharepoint Designer Installed;
  • Create a List Workflow on List2
  • Add a "Set Field in Current Item" action; Set field to value
  • Set the field to HOD
  • Set the value to a lookup from List1 enter image description here
  • In the Find the List Item section the Field is Department (from List1) and the Value is Department from CurrentItem (i.e. List2). You specify this by clicking on the fx button.
  • You must specify the Return field as Lookup Value (as Text) or the lookup will fail enter image description here
  • Finally, remember to select on Create and Modify under the workflow start conditions enter image description here

Here is the item in List1; enter image description here

And here is the item in List2 for a lookup to Department A after the workflow has run; enter image description here

Hope this helps?!

  • Thanks, but that is not my requirement. I want it to be done using code, not by workflow. Could you help me with that? – sandeep Apr 30 '18 at 13:31
  • If you post an example of the code you are using to solve the problem for a single person/group then I might be able to help. It is not clear from your post when you are triggering the event to fetch the multiple person/group from List1; is it when you have selected the Department? Is this in Add New Item view? Context always helps. – unibod50 Apr 30 '18 at 13:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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