How to dynamically populate picklist using displayformat

How to dynamically populate picklist using displayformat

I created a stateless form with a lookup field that imports the ID value of the linked field but uses the Advanced Display Options to display another field (FullName in this case). This all works perfectly.

Here's the script for the lookup field:
      must  have  Student
        (
            type  =  picklist
            values  =  Students.ID
            displayformat = [ FullName ]
            width  =  206px
        )

Here's the script for the Submit button:
  1.       Submit
  2.         (
  3.             type  =  submit
  4.             displayname  =  "Update"
  5.             on click
  6.             {
  7.                 //add student to selected group
  8.                 recStudent  =  Students  [ID == input.Student];
  9.                 recStudent.Small_Group = input.Small_Group;
  10.                 reload;
  11.             }
  12.         )

I'd like to dynamically populate the list based on another field (Filter) on the form. I have the script written to do this:

  1. if((input.Filter  ==  "Unassigned Students"))
  2. {
  3.     studentList = Students[Small_Group is null] sort by FullName;
  4. }
  5. else if((input.Filter  ==  "Assigned Students"))
  6. {
  7.     studentList = Students[Small_Group is not null] sort by FullName;
  8. }
  9. else
  10. {
  11.     studentList = Students[ID != 0] sort by FullName;
  12. }
  13. Student:ui.add(studentList.FullName.getall());

This displays correctly, but I can't figure out how to get access to the ID value so that I can save it in the data record instead of the FullName value. Is there some way to mimic the use of the displayformat property in the ui.add function?