Don't be put off by this; I suspect its almost a rite of passage or the equivalent of a hazing ritual to see how each new person handles the heat, and it'll happen again next-time new people start.
Yes, it hit you hard, but now you're armed with better knowledge of the conditions and can come more-prepared.
You should go back the next day more-prepared.
Wear a full-brimmed sunhat (not a cap)
Take a plastic water bottle that you can have on you at all times, like a belt holster. Have a second bottle as backup - both should be 600mL to 1L in capacity.
Drink from that water bottle, frequently. Several times an hour at least, aim to empty the bottles just about Lunchtime when you can refill.
Personally I like a small squirt of lime in my water, others prefer lemon, sports drink/electrolite powders. Sugared drinks generally don't help with hydration so avoid juices and soft drinks. Cold/chilled is nice but unless you carry a thermos/vaccuum flask, it soon warms up anyway.Apply sunblock to exposed skin and rub it in. You may need to reapply at lunch if you sweat it out.
Wear white or light coloured clothing that is fairly loose-fitting and made of thin cloth. Do not have it tucked in (presuming you're not working around machinery) Consider where the sun hits you most, and perhaps try a long-sleeved shirt instead of a tee shirt.
Consider wearing some functional sunglasses too - not so much for the heat but its likely bright as well, and reduce eyestrain.
Get out of the sunlight whenever the opportunity presents itself. Standing in any form of available shade for a moment will help a lot.
If you have facial hair, consider trimming it to improve air flow.
I bet you weren't peeing a lot either - because all your body fluids were being sweated out through the skin and lost to evaporation. Not needing to piss means you're low on liquids, so chug half a bottle immediately. That's a warning sign, don't ignore it.
As for the workplace - you've learned, demonstrate that you can adjust, and perhaps if you see the signs of someone else suffering in the future you're pre-warned and can help them avoid the unpleasant crash. This demonstrates your empathy and compassion, along with your observation skills and future leadership potential.