The saving throw and damage roll are independent of each other
While most answers suggest that damage is rolled after the save, based on wording or "common sense", I will offer the opposing perspective: there is no sequential temporal relation between the two dice rolls.
Spells that require a saving throw are either condition appliers (buffs/debuffs), or damage dealers. Out of those that deal damage, a vast majority are area of effect spells, with a few exceptions having a single target.
Area of effect spells offer a save-or-take-half-damage approach, imposing a saving throw on all the creatures in the spell's area. This damage is caused by the spell in an area, regardless of the number of creatures hit, and is the same for all creatures in the area. A creature succeeding on its saving throw takes half damage, but the damage that is halved has to already exist for the creature to be able to avoid the brunt of it. The fact that none, one, or all creatures succeed their save is inconsequential to the spell's damage. If anything, the saving throw is caused by the damage dealt, and not the other way around. This is further enforced by the fact that halving damage is done by taking half of the dice roll result (rounded down), and not by rolling half the dice.
For single target spells, conditioning the damage roll on the save success seems like a natural choice, but only because most (I have not been able to find any example contradicting this) single target spells that require a saving throw offer a save-or-take-no-damage approach. However, this is just a method of reducing the number of rolls by taking advantage of the fact that no damage is received on a successful save.