Constipation in newborn

Chantis

I have a newborn and he has recently switched from breast milk to formula due to me not producing enough milk supply. So I first started him with the silver similac formula and it gave him really bad constipation. So I was recommended to try the purple formula for east digest and fussiness and colic but this has him spitting up a lot but he poops more then before but still having trouble getting it out. Any recommendations for constipation or a different formula to try ?