In this paper, we report a new method to incorporate 3D scaffold with electrotaxis measurement in the microfluidic device. The electrotactic response of lung cancer cells in the 3D foam scaffolds which resemble the in vivo pulmonary alveoli may give more insight on cellular behaviors in vivo. The 3D scaffold consists of ordered arrays of uniform spherical pores in gelatin. We found that cell morphology in the 3D scaffold was different from that in 2D substrate. Next, we applied a direct current electric field (EF) of 338 mV/mm through the scaffold for the study of cells' migration within. We measured the migration directedness and speed of different lung cancer cell lines, CL1-0, CL1-5, and A549, and compared with those examined in 2D gelatin-coated and bare substrates. The migration direction is the same for all conditions but there are clear differences in cell morphology, directedness, and migration speed under EF. Our results demonstrate cell migration under EF is different in 2D and 3D environments and possibly due to different cell morphology and/or substrate