I was planning to go there.

Literal

I [topic-は] there [to-へ] go [intention-つもり] was.

つもり expresses speaker's intention or plan. Combined with だった (past copula), it means 'had planned to' — and by implication, the plan may or may not have been realized. へ marks direction of movement ('toward there'), similar to but slightly different from に (destination/arrival point).