extract field on condition