I have a few thousands of polygons, which I found the centroid for each one of them. Now I want to find the coordinates of each centroid. But for some reason the x and y columns are empty and I don't know how to fix it.
QGIS now has a centroids tool builtin.
Go to Vector > Geometry tools > Centroids
Select your input polygon layer, and output file, and Run
That gives you the centroids on the map, but the coordinates may be
hidden in the geometry column and not shown to you in the attributes table, so finally you may wish to...
Export as CSV
Now viewing the attribute table gives the coordinates: