I have heard it is the metal ions that are the reason for flame colour during a flame test. so in covalent bond, there are no metal ions does that mean covalent compounds don't produce flame colour. if not what is the reason, if yes why doesn't glucose produce colour. Also is it possible to identify whether a substance is ionic, or covalent with just the flame test. I have searched the web but there are no clear explanations.
The colors produced in flame tests are the result of electrons becoming excited and returning to their ground states, releasing photons of characteristic colors. Different colors from flame tests result from different energy gaps between the electron shells in different atoms. Since flame tests determine properties of individual atoms, they cannot be used to determine if a compound is ionic or covalent. In fact, bonds are normally broken when a compound is placed into a flame, so it would be nearly impossible to use a flame test to find anything about the bonding nature of a compound. Glucose does not produce a color when it is burned because it just undergoes combustion - more or less the same reaction that is creating the flame in the first place.
On the other hand, there are other ways to determine if a compound is ionic or covalent. Ionic compounds normally have ridiculously high melting points, and if you put an ionic compound into distilled water, it will conduct electricity. There are lots of tools to determine if a compound is covalent or ionic; however, a flame test is not one of them.