Mercury iodide is insoluble in water, but with an excess of iodide, a colorless tetraiodomercurate complex is formed. Such a solution is called Nessler's reagent and is used to determine ammonia or ammonia salts (yellow color appears in their presence).