As G3 was mentioning you could use a comparison on the source voltage. For most controllers that'll be C1P2.voltage, and you could just check to see if it's greater than 20V to determine which voltage source you've got.
No, you can't connect the signals as you've done in that image. You will want to use either a Boolean Switch or a couple of Value Connect components along with that comparison that I mentioned.