The reaction will work, but more slowly than with the nitrile because amide is a weaker electron-withdrawing group.
A different problem that might pop up is that if your nucleophile is a strongish base and your amide is primary or secondary, the amide or its anion might take over the role of the nucleophile. Don't have any practical experience with this, though.