I found this article, I guess it works for both constipation or diarrhea, even works for cats
If your dog or cat is having the occasional case of constipation or diarrhea, one of the things that might help is canned pumpkin. Yes canned pumpkin in its pureed form (NOT pumpkin pie filling) is a fantastic stool softener which makes it a good natural remedy for constipation. It often helps with upset stomach or indigestion for both cats and dogs. It is very rich in fibre and adding just one or two teaspoonfuls to your pet's food often gets the system moving in no time. Dogs will occasionally want to eat it directly and that's fine too. Sometimes though, finicky cats and dogs won't touch it no matter what you do.
On the opposite end of things is diarrhea. Since the dietary fibre in canned pumpkin absorbs water, it can be a great help to a cat or dog that has diarrhea. Some pet owners report that it firms up their pet's loose stools or diarrhea within a few hours. Again one to two teaspoonfuls is all that is needed.