Advanced Generation series
Electivire was caught during Gary's journey through Sinnoh sometime during his research in this region. Its first appearance was in Home Is Where the Start Is!. It looked as if it was a wild Electivire at first because it was shooting apples by itself from a tree with its Thunderbolt. Team Rocket attempted to take it by capturing it in an electricity-proof net. It looked as if they were about to succeed until Gary showed up and told it to use Iron Tail to cut free of the net. Once out, it zapped Team Rocket with Thunder Punch and they were sent flying.
Ash was impressed by Electivire, but as he looked it up on his Pokédex there was no data on it. Ash then wanted to battle it, but Gary said to come back to the lab first.
Once there, Ash sent out his Pikachu to fight Electivire. Unfortunately for him, Electivire proved too much for Pikachu to handle and he ended up losing. When Gary left for Sinnoh, he took Electivire with him.
Diamond & Pearl series
Electivire appeared again in Ill-Will Hunting! as it fought by Gary's side against Pokémon Hunter J and her henchmen in order to protect the Shieldon from being captured. It was called on again to sabotage J's ship, using Thunderbolt to cause explosions and then tackling J's henchmen with Umbreon to allow Ash to retrieve Shieldon.
Gary used Electivire and Umbreon to battle against Saturn's Toxicroak in The Needs of the Three!, when trying to stop Pokémon Hunter J from giving the three lake guardians to the Team Galactic Commander. However, Toxicroak had both of them under control all the time. When Electivire attempted to use Thunder to stop Hunter J, it was badly hurt by Toxicroak's Poison Jab before it could attack.