[client] Clean up setSelectedTriggerId() by using helper functions.