Dropdown to text

The use case is to select a company name (title) from a dropdown (#dropdown1), populate the value in a text field or input and then save to a dataset (#submitInfluence). The problem is the text field is connected to a dataset filter and populated with the title, but the input (not connected) is populated with the title_id.

I’m aware that I need to use a function to setfieldvalues and insert the data in the input field, but not clear on how and where I do that.