In this article, a solution for electromagnetic scattering by a shallow triangular cavity is suggested using the modal expansion technique. First, a domain decomposition approach is employed to divide the half‐space above the cavity into two sub‐regions. The tangential fields within the sub‐regions are expanded in terms of an infinite series of appropriate basis functions in two different coordinate systems. The fields are then expressed in a similar coordinate system by utilising the Graf's addition theorem. Eventually, the unknown coefficients are computed through satisfying the continuity of the tangential fields at an auxiliary boundary. Some examples are given to demonstrate the validity and reliability of the proposed method