I am wondering i any of the metering system works with built in or external flash ? because whenever I take pictures using the flash it always shows underexposed on the metering so how to judge the right exposure while using flash ?
Re this original question.... the camera light meter that we see is only about the ambient exposure. TTL flash is metered too, but it has its own invisible system that we cannot see.
The ambient metering sets the camera settings, like shutter speed and aperture and Auto ISO. Then when the shutter button is pressed, the flash has to deal with those settings, and provide the correct flash power level to match them. Speedlight power level is controlled with flash duration. Film TTL cameras just quenched the flash off when exposure was seen to be enough. Current iTTL cameras instead meter a low level preflash, and then compute and set the flash power level directly, in advance of the actual flash.
There are several ifs and buts, some differences in camera modes (A,S,P, M), and some Auto ISO differences in camera models.
In the general theory, the ambient metering and settings are the same regardless if flash is used or not (the ambient is what it is). However, there are common exceptions. For example, with the flash turned off, in camera A mode, maybe you set f/5.6. Then if you meter a scene indoors, perhaps it says 1/4 second shutter speed (dim, and too slow, so we need flash). Reach up and turn on the flash, and shutter probably changes to 1/60 second, which is a Minimum shutter speed with flash (in modes A or P, but some models can change that with an E2 menu). This is not about exposure, the system just assumes if we are using flash, we don't need 1/4 second.
Or if outdoors in bright light, a fast shutter speed is reduced to Maximum sync speed (1/200 or 1/250 second).... again, NOT about flash exposure, but the change may affect ambient exposure. Auto ISO may be substantially reduced too, in the older and the few latest newer iTTL cameras. But there is a midrange period of models when the flash was always working into high ISO, set for the less bright ambient.
Auto ISO is hardest to describe, because it has changed a couple of times. Older iTTL cameras up through the D300, never allowed Auto ISO to advance at all if flash was detected used. We are using flash instead of ISO. There was one exception, a hot shoe flash might allow Auto ISO to increase some if the flash power was not otherwise sufficient for the metering.
But then starting with the D300S, all camera models ignored flash when determining Auto ISO value, so in a dim room, Auto ISO was always very high, even with flash.
Then the last few newer models (starting with D800) corrected this, and now will only allow Auto ISO to advance 2 stops (ISO 100 to ISO 400) if hot shoe flash is detected used (the internal flash still always sees high ISO). And same exception, if the hot shoe flash limits out on power, Auto ISO can advance more then. That is very much more reasonable.
Bounce normally does need ISO 400, but if you see that your camera is using very high ISO with flash, you probably should turn Auto ISO off.