Did her doctor eliminate a milk protein allergy? Did he test for a soy allergy? My granddaughter was allergic to both milk protein and soy.
I suggest that you want to stay with one formula for a period of time to allow her system to adjust to it. The constipation and diarrhea may not even be related to the formula.
When you say she was constipated what were her symptoms? Her system may have difficulty with a firm stool because she's had runny stools so often. I've read that the muscles that push the stool down and out can become weak. I would go back to the soy formula because her stool did firm up. Then if she did not have a bowel movement I would either use my lubricated finger (very short nail) or a lubricated gloved finger to help the poop come out or use a suppository to lubricate the passage.
My brothers all had difficulty with constipation back in the day before all of the helpful medical info. She helped them with their movements with her finger. My grandson also had constipation issues and just a few years back could not pass a stool and was in serious pain. An EMT helped him pass the stool with a gloved finger. This is a viable option.
Runny stools for a short term will not be a problem, unless you were told differently by her doctor, if they do continue. Just be sure that she does not become dehydrated. Constipation for a short period is also not harmful. I do think constipation is easier to deal with than diarrhea. At 8 months she can eat solids. If she is doing so and is constipated give her plenty of fruits and vegetables with fiber. Give her prunes and prune juice. Apple and grape juices are helpful. Crackers with fiber. No cheese or dairy products. no bananas. Avoid the foods on the BRAT diet. bananas rice, applesauce, and toast. These are foods to help with diarrhea so you could give them when she's having diarrhea.
If she's eating solid foods, change her diet rather than her formula.