so basicaly you want to be using the selection api to retrieve the selected objects right?
you can do this by getting
var selState = app.selectionState( );
this returns a selection state object wich is like this
yo will need to get the .QFieldSelectionsand then the qselected field.
after you get the fields and values you could easily post them to your next url trough string concatination
hope this helps.