Trouble Setting Multi-Select Field on User Input

Trouble Setting Multi-Select Field on User Input

Hi -
Having trouble getting a multi-select lookup field to pre-populate based on user input.  Form A contains list of all Employees and the Location where they work.  Form B creates new projects and includes a lookup field to Form C containing a list of project team groups and a multi-select lookup to Form A allowing the user to assign employees to the project.  I'd like it so that if the user makes a certain selection for the team group (say, "New York Employees"), the multi-select field will pre-populate with all employees that meet that criteria.  This code works to set the multiselect on load:

  1. input.team_members = FormA[Location = "New York"].ID.getAll();
But, when I try to add the If statement based on user input, the multiselect does not pre-populate:
  1. ref = FormC[Project_Group = "NY Team"];
  2. if(input.Project_Team_Group = ref.ID)
  3. {
  4. input.team_members = FormA[Location = "New York"].ID.getAll();
  5. }
Thanks for your help.