Previous questions/answers explain how to output vertex color from Geometry Nodes, but they rely on being able to select a vertex color slot in the Geometry Nodes modifier's Output Attributes:
Geometry Nodes output to vertex color
Is it possible to set/manipulate vertex colors from geometry nodes?
That option only seems to be available when you are passing the input geometry along to the output.
If you are ignoring the input geometry, and generating your own geometry within Geometry Nodes, you don't seem to be able to route your output color into a vertex color slot.
In this example (screenshot 1), if I connect the input geometry to the Subdivide Mesh node, I get the 'Face Corner -> Col' option and the vertex colors show up (I'm using Color By Vertex in Viewport Shading). When I connect the Cube node instead (screenshot 2), the colors don't show and the Col option isn't available.
So I guess I am asking, is there a way to generate a vertex color data slot on the generated mesh?
This is in Blender 3.1.0, but I think behavior is the same in 3.0 and 3.2 Alpha.
Blend file: https://pasteall.org/media/3/3/339caf4fa163ae5b0068cfccef17254d.blend