How to display content of filtered data on UI or PDF viewer?

Here is my usecase:
I have 3 drop downs ( connected to 3 collections ) and one button.
Drop down 1- shows grades [ Grades collection]
Drop down 2 - shows subjects
Dropdown3 - shows topic
Get Question button - On click of a this button and based on the user selection in 3


Hope I am clear with my problem statement.
Can somebody help me with the code ?