Hello,
This is my 3rd pregnancy, I do remember having slightly similar issues previously but much worse this time 
I'm 22 weeks now, at least since around Christmas time I've had on & off where I have abour 3/4 days of constipation and then I'll get sudden urge to go to the toilet and if can often be like diarrhoea almost, I wondered if stomach bugs from my son at school at first but it's a definite pattern going on! It's not so bad if I'm at home as I am most of the time but I get anxiety going out now if it will happen when im outside and I suddenly need the loo! Plus I get quite bad wind aswell 
Normally I just go to the loo once a day and I can get ibs symtpms sometimes. Is there anything can help or midwife can give for this? My issue is once I need to go I need to go! Quite embarrassing 🫠