Sweet potato is a good source of potassium about x4 that of a banana. Coconut is another source. Potassium isn't the only electrolyte. Ordinary table salt is another. A lesser known problem is people who have too little salt. I would make sure you are getting the recommended amount. I would also recommend general fitness. I used to get cramping, lots of muscle spasms, etc. it is much reduced.
I do get random cramps like you say, like I had a weird one where it was one side of my abdominal it has sort of caved in. it wasn't painful but very weird looking.
The worst cramps I have got from puking my guts out then hyperventilating. It is always worth having some electrolyte handy, when you get a tummy bug, because you don't want to stay two days in hospital (apart from the isolation ward, which was cool).
If you are retaining fluid in the abdominal region from inflammation, then it is normal to get pain and cramping in and around.