IF it is caused by heat and the person has taken liquids, it is usually a need for ordinary salt or potassium -- as in a banana or watermelon. A pinch of table salt can do wonders under those conditions.
But if that is not a uniform index to the episodes, a set of medical tests might be in order.
A