Dynamic dropdown selection in desktop application based on condition

No need to loop through every item, just check what is the dynamic and static part, based on that you can create the selector and use that selector for transid selection.