Prepopulate Input Form from Datatable

I have one question.

I want to prepopulate the input form from datatable.
Datatable consist of two columns i.e Student and Roll No.

In input form i have two inputs.

  1. “Student Name” which is dropdown from the datatable first column(student)
  2. “Roll No” should be autopopulate from the option selected from 1st input and value should be datatable second column(roll no) i.e., “Student Name”

This question is not pretty clear, can you please post a graphics or screenshot around what you would like to achieve.