If you are bloated, then frequent urination can be due to pressure of a gas-filled rectum on your bladder.
Food related causes of bloating include:
- fructose malabsorption (low-fructose diet could help)
- lactose intolerance (lactose-free diet helps)
- irritable bowel syndrome (avoiding sugary foods and dairy could help)
- celiac disease (gluten-free diet helps)
One quite common cause of bloating are also intestinal parasites - diagnosis is by a stool test performed by a gastroenterologist.