ReplaceAction function

Create a replace action.