Unfulfilled intentions (iba a...)

I was going to...

To explain what you were going to do before plans changed, use the imperfect tense of ir (to go) followed by a and an infinitive.

SubjectImperfect of ir
yo / él / ella / ustediba
ibas
nosotros / nosotrasíbamos
ellos / ellas / ustedesiban

These intentions are often followed by pero (but) to explain what went wrong.

I was going to call you, but the phone died and I didn't have the charger.
Iba a llamarte, pero el teléfono se descargó y no tenía el cargador.
We were going to go out, but an unforeseen event came up.
Íbamos a salir, pero surgió un imprevisto.
She was going to arrive today, but she got delayed by an unforeseen event.
Ella iba a llegar hoy, pero se retrasó por un imprevisto.
I was going to pay the bill, but I forgot my wallet.
Iba a pagar la cuenta, pero olvidé mi billetera.
I am sorry about the problem, I was going to send you an apology.
Lamento el problema, iba a enviarte una disculpa.