First Valid allows you to handle possible graph evaluation errors by providing alternative branches.
For example, here’s how you’d set up a compound to use either an attribute value or a value entered in the compound PPG. In this example, the PPG value is the fallback: if the attribute is not set, the value from the PPG is used.
Here’s another example. If there’s a texture map on the object, First Valid will pass through the texture map color. Otherwise, solid black is used.
Note that you don’t need to keep the constant color node. You just need it to force the type (Color) of the First Valid node.
After that, you can simplify to this:
Might be interesting to add, that a connection that comes from the input port of a compound directly, is always valid, even if it’s not connected.
(this was my personal GOTCHA recently ;))