Perspective Dropdown Value and Text Output

After a little search, found an example of python dataset looping, and here is the resulting, and working, code, which does, indeed, return the user's selected name:

def valueChanged(self, previousValue, currentValue, origin, missedEvents):
	if currentValue and currentValue.value:
		val = currentValue.value
		if val is not None:
			dataset = self.props.options
			pyDs = system.dataset.toPyDataSet(dataset)
			for item in pyDs:
				if val in item:
					val2 = item[1]
			self.custom.selected_index = val
			self.custom.selected_label = val2

EDIT:
I don't think I have any need for the selected_index, though, as this code came from another use case in another thread here:

Which, I think I had a similar question back on that thread, but don't recall what I was working on then and what I did with it, lol.