不得已而為之

Idiom

 * 1) to do something against one's will; to have no choice but to do something