You need to specify the value that should be output when Type is not "Road" between else
and end
in your formula. If you need to specify values for other types you can do so with something like:
if field('Type') == 'Road' then random(500000,5000000) elsif field('Type') == 'Bridge' then random(1000,10000) end