Toddler bowel problems

Sa

Anyone ever dealt with your toddler going from chronic constipation then like a complete switch to chronic diarrhea? If so has anyone ever found a solution or what the cause was?

I also want to add that the diarrhea has been sandy/grainy in texture and had a very distinct smell.