NB Constipation Relief

We’ve recently had to switch our son to anti reflux formula (he is 3 w/o) and it is making him extremely constipated as the doctor said it probably would. He is constantly grunting in pain and straining but when he poops it is like a little ball ☹️ is there anything i can do to help him? We have tried the bicycle kicks and a bath but it isn’t helping!