Disney Wiki
Disney Wiki

"Sidetracked" is the tenth episode of the fourth season of Phineas and Ferb.


Agent P teams up with a partner, a human agent named Lyla, to stop a hijacked train running along the US/Canadian border. In a past mission and their first meeting, they had a falling out, so Agent P must decide whether or not he can trust Lyla and her unique sense of logic to get them through the mission, defeat Doofenshmirtz and save the train's passengers and Canada's national treasure - a Moose named Albert.


In downtown Seattle, three criminals steal parts from a warehouse and leave in a doughnut truck. Perry immediately starts following them on a platy-cycle, dodging attempts to knock him off their tail. Shortly after the chase crosses the Canadian border, Perry is able to hook the truck with his grappling hook, but C.O.W.C.A. agent Lyla Lolliberry takes over the chase, as Perry does not have jurisdiction in Canada. Lyla climbs onto the truck but accidentally detaches the metal arm the hook is attached to, allowing the criminals to escape. Perry attempts to continue the chase, but Major Monogram and Carl immediately call him back to headquarters. Perry leaves as Lyla apologizes.

Two months later, it's another normal day: Phineas and Ferb wake up; Candace makes a deal with Linda to clean the bathroom if she fails to bust the boys that day; and Buford, and Baljeet, and Isabella arrive to assist with the day's project. After walking past all of them, Perry enters his lair through a tree, accidentally crushing a car in the process, and receives his assignment: he must protect Albert the Moose, Canada's national symbol, in order to preserve the upcoming Canada Day ceremonies. However, Albert is riding a train on the U.S.-Canada border, and Perry only has jurisdiction on one side of the train, so Perry will be teaming up with Lyla again. Monogram trusts that Perry will be a professional despite his bad blood with her after the failed Seattle assignment, and wishes him luck.

Perry and Lyla arrive at the train at the same time, and they drop into a fine dining car, sharing a booth with Dr. Doofenshmirtz. Doofenshmirtz points out that they are currently trapped by societal convention - you can't make a scene in a fine dining establishment - and that he's participating in a U.S.-Canada evil exchange program, where he and a Canadian villain will trade evil schemes for a day. Doofenshmirtz promptly reveals his scheme: he has tied up the conductor and hijacked the train using his remote control Train Operator-inator, where he will hand over Albert to his exchange partner, ruining the Canada Day celebration. Lyla figures out that the exchange partner is her arch-nemesis, Professor Bannister, and Doofenshmirtz confirms this. However, Lyla has been trying to eat Doofenshmirtz's fries throughout their conversation, and he expresses how much this annoys him. Lyla gives Perry a wink, and they both begin messing with the fries, causing Doofenshmirtz to make a loud scene, disrupting the fine dining atmosphere.

Recognizing that his social convention trap has been foiled, Doofenshmirtz flees to the next car, but trips over the tied-up conductor. After a brief struggle, Perry ends up with the Train Operator-inator, but Lyla tries to take it from him and they both lose their grip, unintentionally returning it to Doofenshmirtz. They end up fighting again, but they somehow end up brawling with the conductor instead, and Doofenshmirtz escapes through the train's bathroom window, climbing onto the roof. Lyla and Perry follow him, but Lyla falls off after the train hits a bend in the track; Perry tries to pull her back off, but falls off too.

Lyla immediately notices a handcar next to the track, but Perry tries to operate it himself, slowing them down. Lyla teaches Perry how to operate it, and as they travel down the tracks, she metaphorically equates the handcar to teamwork: she and Perry have to work together to stop Doofenshmirtz.

After Doofenshmirtz boots a passenger off at his station (without stopping), another commuter notices Perry and Lyla operating the handcar on the adjacent track, and everyone starts taking video of it. Doofenshmirtz's cell phone alerts him to the trending video, and he starts watching it just as Perry kicks him in the face. Doofenshmirtz uses an installed platform to rise to the roof again, and while gloating to the two agents about how he cannot be stopped as long as he has the -inator, a tunnel entrance smashes the remote in his outraised hand. This causes the train to go completely out of control. Back in Danville, Phineas wonders where Perry is.

On the now-runaway train, Lyla immediately realizes there's an emergency break in the engine car, and Doofenshmirtz decides to join the two agents in their attempt to stop the train. While running to the engine car, Doofenshmirtz, after dodging three obstacles because he had to tie his shoes, falls into the toilet he'd escaped through earlier, so Lyla and Perry go ahead without him. They reach the engine car, but Lyla is only able to fix the hazard lights, the emergency brake being inoperational. Perry realizes they can save everyone by getting them all into the caboose, where Albert is, so Lyla uses the PA system to tell the passengers to gather in that car. She, Perry, and Doofenshmirtz join the passengers in the caboose, which slows down; Perry had separated that car on the way there. Everyone rejoices that they're saved, but a large claw grabs the caboose and lifts it into the air.

Lyla sees that it's Bannister in a helicopter who's grabbed the caboose, so she and Perry grapple their way into the chopper, Doofenshmirtz climbing up behind them. Bannister remarks that they're now trapped in the helicopter. Doofenshmirtz realizes that Bannister must have finished his scheme early, and Bannister remarks that it was easy; he had to flip one switch on Doof's -inator. Bannister now revels in the fact that he has Albert the Moose in his custody, and Lyla calls him out for not being a true Canadian. Bannister reveals that he's not actually Canadian: he's from Greenland. His goal is to remedy the lack of Greenlandic national pride by causing Canadians to forget their national identity, allowing him to annex Canada for Greenland and institute his own pride-producing changes to his homeland, such as a new national anthem. Doofenshmirtz argues that Bannister's plan is far too complex to actually work, but Bannister begins apparently arguing with his shoulders. Upon seeing Lyla's confusion, he reveals two magnetic Bannister robots, built using the stolen parts from the Seattle job, whose culprits are playing cards in the helicopter. Lyla reveals that she intentionally let them escape, knowing they'd lead her to Bannister.

During the ensuing Helicopter Fight, Perry and Lyla trick the robots into magnetically attracting each other through the chopper roof, defeating them. Bannister, realizing he's lost, throws his Greenland flag on the two agents and parachutes away, but is immediately captured by Peter the Panda in an O.W.C.A. plane; Perry had texted Monogram during the fight, and Monogram sent Peter over. The villains defeated, Lyla brings the caboose-carrying chopper to the Canada Day celebration.

At the celebration, the Canadians celebrate their country (and Albert), the villains are all arrested, and Lyla explains that she had a tracker on Bannister's goons' donut truck. Monogram and Carl arrive to congratulate Lyla and Perry, and Doofenshmirtz suggest they visit Niagara falls, which the five of them (and Peter) do. As they all leave, Doofenshmirtz ponders how his scheme - the Cloud Magnetiz-inator - turned out.

Back home, Candace runs to get Linda; Phineas wonders how a cloud could have carried away their metal superstructure; and Linda, upon seeing nothing there, hands Candace a toilet brush. Perry walks up to his owners, who greet him, remarking, "A platypus's life is a life of leisure".

End credits

Monogram apologizes on behalf of the viewers that the show did not mean to make fun of Greenland and gives a short explanation of its flag.




  • When Lyla first appeared, she was wearing a motorcycle suit. But after the criminals escape, she wears her normal attire.
  • Despite taking place the day before "The Bully Code", Doofenshmirtz's backstory is never mentioned or seen.
  • In the picture that Perry texts to Major Monogram for back up, Professor Bannister is missing his glasses.
  • The episode incorrectly states that the Canadian Constitution Act was passed in 1864, when it was actually passed in 1867.
  • When Doofenshmirtz goes up to his Escape Platform, his hand with the Train Operator-inator passes through the edge.
  • The first time the engine is shown, it has no rear truck (wheels), so it is floating.
  • This episode takes place before "The Bully Code", which takes place on Canada Day. The celebrations were held in this episode. However, this episode could have taken place over two days.
  • When Lyla and Perry fall off the roof the train, its whistle blows. However, the train's engine is very obviously a diesel locomotive, which could not possibly have a steam whistle. An air horn would have been more appropriate.
  • A sign in Seattle at the beginning of the episode shows Interstate 13 North. The only interstate running north is Interstate 5. There are also no highways numbered 13 in Washington, let alone the US.
  • During Helicopter Fight, when Lyla's jacket is on, she's wearing blue pants and black boots. But when it comes off, they suddenly change into blue and black striped leggings.
  • As the screen pans down at the very beginning, the writing on the donut truck is reversed.
  • Perry is absent from the initial wide shot at Niagara Falls.
  • When the Royal Mountie is arresting the villain, the Mountie is wearing a dark blue suit rather than the traditional red suit.


  • This is the first two-part episode of Season 4.
  • It is revealed that Perry has a smart-phone.
  • This is the second time Perry's chatter is understandable. The first time one in Norm Unleashed".
  • The moose is named Albert, which is also the name of Irving's "brother.
  • This episode takes place sometime around "Phineas and Ferb's Quantum Boogaloo", since Phineas and Ferb are building the super-structure.
  • Monogram breaks the fourth wall during the credits sequence by addressing the viewer, as does Doofenshmirtz when first climbing onto the train's roof.
  • Both Samantha Bee and Kevin McDonald, who play the Canadian counterparts of Perry and Doof, are natives of that country (Bee was born in Toronto, while McDonald was raised in Montreal).
  • The theme that plays during Agent P's pursuit of the thieves is in the style of (Don't Fear) The Reaper by Blue Öyster Cult.
  • The scene taking place in front of Niagara Falls follows the ending of Ocean's Eleven. Dr. Doofenshmirtz is the last to leave, and as he does so, he walks past a group of ten men standing at the railing, watching the waterfall. The sizes, positions and appearance matches the scene where Danny's crew stands in front of the Bellagio to watch the fountains.
  • The scene in which Perry is teamed up by Lyla is similar to the 1994 film, Felidae.
  • While fighting Doofenshmirtz, Lyla says, "This is for William Hull and the War of 1812. Look it up, kids!" During the War of 1812, Hull invaded Canada.

International premieres

  • May 1, 2013 (Disney Channel Spain and Portugal)
  • May 15, 2013 (Disney Channel France)
  • June 30, 2013 (Disney XD Netherlands)
  • June 9, 2013 (Disney Channel Asia)
  • June 15, 2013 (Disney XD Germany)
  • July 1, 2013 (Family Channel Canada and Disney XD Canada)
  • July 14, 2013 (Disney XD Poland)
  • August 5, 2013 (Disney XD Poland)
  • August 18, 2013 (Disney Channel Brazil and Latin America)


Phineas and Ferb Wiki-wordmark.png This page uses Creative Commons Licensed content from the The Phineas and Ferb Wiki. The list of authors can be seen in the page revision history (view authors). As with Disney Wiki, the text of The Phineas and Ferb Wiki is available under the CC-by-SA Free Documentation License.

v - e - d
Phineas and ferb logo.png
Animated Productions: Phineas and FerbVideographyTake Two with Phineas and FerbPhineas and Ferb the Movie: Across the 2nd DimensionPhineas and Ferb the Movie: Candace Against the UniverseChibi Tiny Tales

Video Games: Phineas and FerbPhineas and Ferb Ride AgainDisney Channel All Star PartyPhineas and Ferb: Across the 2nd DimensionAgent P Strikes BackPhineas and Ferb: Quest for Cool StuffWhere's My Perry?Disney Infinity (2.0) (3.0) • Phineas and Ferb: Day of DoofenshmirtzWhere's My Summer?Where's My Valentine?Where's My Holiday?
Albums: Phineas and FerbPhineas and Ferb Holiday FavoritesPhineas and Ferb: Across the 1st and 2nd DimensionsPhineas and Ferb: Star Wars soundtrack
Stage shows: Phineas and Ferb: The Best LIVE Tour Ever!

Disney Parks
Agent P's World Showcase Adventure

Entertainment: Phineas and Ferb's Rockin' Rollin' Dance Party
Firework: Celebrate the Magic Parade: Move It! Shake It! MousekeDance It! Street Party

Major Characters: Phineas FlynnFerb FletcherCandace FlynnPerryDr. Heinz Doofenshmirtz

Secondary Characters: Linda Flynn-FletcherLawrence FletcherIsabella Garcia-ShapiroBaljeet TjinderBuford Van StommMajor Francis MonogramJeremy JohnsonCarl KarlStacy HiranoGinger HiranoMillyKatieHollyAdyson SweetwaterGretchenVanessa Doofenshmirtz
Recurring characters: Giant Floating Baby HeadDjango BrownColtraneCharlene DoofenshmirtzRoger DoofenshmirtzVivian Garcia-ShapiroIrvingJenny BrownSuzy Johnson Nana Shapiro• • DannyBobbi FabulousShermanMeapMitchNormClyde FlynnBetty Jo FlynnPinkyAlbertPeterKlimpaloonTalking ZebraMonty MonogramHildegard JohnsonReginald FletcherWinifred FletcherAloyse von Roddenstein
Minor Characters: JerryBigfootYetiKhaka Peu PeuThe RegurgitatorBob WebberPrincess BaldegundeMelissaUnnamed Fireside GirlsAgent EBrobotsDrill SergeantBuck BuckersonTiana WebberJack JohnsonMrs. JohnsonWendyEliza FletcherNicoletteMandyThaddeus and ThorMindyAmandaLucy FletcherAdrian FletcherBeppo BrownDr. HiranoAnnabelle JohnsonSaraBrigitte, Josette, and ColletteMishti PatelLiam McCrackenRodrigoMorgGlenda WilkinsDr. GevaarlijkHeinz Doofenshmirtz's motherBlanca DishonProfessor PoofenplotzEliza M. FeyersiedLyla LolliberryBalloony • Corn Colossus • Professor Parenthesis
Guest Characters: Santa ClausKim Possible PinocchioBaby BaboonThor OdinsonSpider-ManHulkIron ManRed SkullNick FuryVenomWhiplashMODOK

Season One: "Rollercoaster" • "Candace Loses Her Head" • "The Fast and the Phineas" • "Lawn Gnome Beach Party of Terror" • "The Magnificent Few" • "S'Winter" • "Are You My Mummy?" • "Flop Starz" • "Raging Bully" • "Lights, Candace, Action!" • "Get That Bigfoot Outta My Face!" • "Tree to Get Ready" • "It's About Time!" • "Jerk De Soleil" • "Toy to the World" • "One Good Scare Ought to Do It!" • "A Hard Day's Knight" • "I, Brobot" • "Mom's Birthday" • "Journey to the Center of Candace" • "Run Away Runway" • "I Scream, You Scream" • "It's a Mud, Mud, Mud, Mud World" • "The Ballad of Badbeard" • "Dude, We're Getting the Band Back Together" • "Ready for the Bettys" • "The Flying Fishmonger" • "Phineas and Ferb Get Busted!" • "Greece Lightning" • "Leave the Busting to Us!" • "Crack That Whip" • "The Best Lazy Day Ever" • "Boyfriend From 27,000 B.C." • "Voyage to the Bottom of Buford" • "Put That Putter Away" • "Does This Duckbill Make Me Look Fat?" • "Traffic Cam Caper" • "Bowl-R-Ama Drama" • "The Monster of Phineas-n-Ferbenstein" • "Oil on Candace" • "Unfair Science Fair" • "Unfair Science Fair Redux (Another Story)" • "Out to Launch" • "Got Game?" • "Comet Kermillian" • "Out of Toon" • "Hail Doofania!"

Season Two: "The Lake Nose Monster" • "Interview With a Platypus" • "Tip of the Day" • "Attack of the 50 Foot Sister" • "Backyard Aquarium" • "Day of the Living Gelatin" • "Elementary My Dear Stacy" • "Don't Even Blink" • "Chez Platypus" • "Perry Lays an Egg" • "Gaming the System" • "The Chronicles of Meap" • "Thaddeus and Thor" • "De Plane! De Plane!" • "Let's Take a Quiz" • "At the Car Wash" • "Oh, There You Are, Perry" • "Swiss Family Phineas" • "Hide and Seek" • "That Sinking Feeling" • "The Baljeatles" • "Vanessassary Roughness" • "No More Bunny Business" • "Spa Day" • "Phineas and Ferb's Quantum Boogaloo" • "Phineas and Ferb Musical Cliptastic Countdown" • "Bubble Boys" • "Isabella and the Temple of Sap" • "Cheer Up Candace" • "Fireside Girl Jamboree" • "The Bully Code" • "Finding Mary McGuffin" • "Picture This" • "Nerdy Dancin'" • "What Do It Do?" • "Atlantis" • "Phineas and Ferb Christmas Vacation!" • "Just Passing Through" • "Candace's Big Day" • "I Was a Middle Aged Robot" • "Suddenly Suzy" • "Undercover Carl" • "Hip Hip Parade" • "Invasion of the Ferb Snatchers" • "Ain't No Kiddie Ride" • "Not Phineas and Ferb" • "Phineas and Ferb-Busters!" • "The Lizard Whisperer" • "Robot Rodeo" • "The Beak" • "She's the Mayor" • "The Lemonade Stand" • "Phineas and Ferb Hawaiian Vacation" • "Summer Belongs to You!" • "Nerds of a Feather" • "Wizard of Odd" • "We Call it Maze" • "Ladies and Gentlemen, Meet Max Modem!" • "The Secret of Success" • "The Doof Side of the Moon" • "Split Personality" • "Brain Drain" • "Rollercoaster: The Musical!" • "Make Play" • "Candace Gets Busted"
Season Three: "The Great Indoors" • "Canderemy" • "Run, Candace, Run" • "Last Train to Bustville" • "Phineas' Birthday Clip-O-Rama!" • "The Belly of the Beast" • "Moon Farm" • "Ask a Foolish Question" • "Misperceived Monotreme" • "Candace Disconnected" • "Magic Carpet Ride" • "Bad Hair Day" • "Meatloaf Surprise" • "Phineas and Ferb Interrupted" • "A Real Boy" • "Mommy Can You Hear Me?" • "Road Trip" • "Tour de Ferb" • "Skiddley Whiffers" • "My Fair Goalie" • "Bullseye!" • "That's the Spirit" • "The Curse of Candace" • "Escape from Phineas Tower" • "Lotsa Latkes" • "Ferb Latin" • "A Phineas and Ferb Family Christmas" • "Tri-Stone Area" • "Doof Dynasty" • "Excaliferb" • "Phineas and Ferb and the Temple of Juatchadoon" • "Monster from the Id" • "Gi-Ants" • "The Remains of the Platypus" • "Mom's in the House" • "Perry the Actorpus" • "Let's Bounce" • "Bully Bromance Break Up" • "Quietest Day Ever" • "Doonkleberry Imperative" • "Meapless in Seattle" • "Delivery of Destiny" • "Buford Confidential" • "The Mom Attractor" • "Cranius Maximus" • "Agent Doof" • "Minor Monogram" • "What a Croc!" • "Sleepwalk Surprise" • "Sci-Fi Pie Fly" • "Sipping with the Enemy" • "Tri-State Treasure: Boot of Secrets" • "Doofapus" • "Norm Unleashed" • "Where's Perry?" • "Ferb TV" • "When Worlds Collide" • "What'd I Miss?" • "Road to Danville" • "This is Your Backstory" • "Blackout!"
Season Four: "For Your Ice Only " • "Happy New Year!" • "Fly On the Wall" • "Bully Bust" • "My Sweet Ride" • "Der Kinderlumper" • "Sidetracked" • "Primal Perry" • "Mind Share" • "Backyard Hodge Podge" • "Bee Day" • "Bee Story" • "Great Balls of Water" • "Where's Pinky?" • "Phineas and Ferb Musical Cliptastic Countdown Hosted by Kelly Osbourne" • "Knot My Problem" • "Just Desserts" • "La Candace-Cabra" • "Happy Birthday, Isabella" • "Love at First Byte" • "One Good Turn" • "Mission Marvel" • "Thanks But No Thanks" • "Troy Story" • "Druselsteinoween" • "Terrifying Tri-State Trilogy of Terror" • "Face Your Fear" • "Cheers for Fears" • "Steampunx" • "Just Our Luck" • "Return Policy" • "Live and Let Drive" • "Phineas and Ferb Save Summer" • "Father's Day" • "Imperfect Storm" • "The Return of the Rogue Rabbit" • "It's No Picnic" • "The Klimpaloon Ultimatum" • "Operation Crumb Cake" • "Mandace" • "Phineas and Ferb: Star Wars" • "Lost in Danville" • "The Inator Method" • "Night of the Living Pharmacists" • "Tales from the Resistance: Back to the 2nd Dimension" • "Doof 101" • "Act Your Age" • "Last Day of Summer" • "O.W.C.A. Files"

Locations at or near Danville: DanvilleSeattleMr. Slushy FranchiseDoofenshmirtz Evil IncorporatedFlynn-Fletcher HouseAtlantisGoogolplex MallOld Abandoned Amusement Park

Other: AfricaEnglandNew York CityBig BenMarsTokyoLondonChinaIndiaCanadaChileHawaii

Today is Gonna Be a Great DaySummer Belongs to YouCity of LoveJump Right InPerry the Platypus ThemePerry Saves ChristmasLet it Snow, Let it Snow, Let it SnowGitchee Gitchee GooWhere Did We Go Wrong?BustedLittle BrothersWhat'cha Doin?Carpe DiemS.I.M.P. (Squirrels In My Pants)I'm MeRollercoasterCouldn't Kick My Way Into Her HeartThe Ballad of KlimpaloonEvil for Extra CreditBackyard BeachHappy New YearGreat to Be a BabyWhat Might Have BeenSerious FunCurtain Call/Time Spent TogetherFollow the SunSilhouettes