Solved by Manuel_Alejandro_Dia in post #2 
              
              
                What you could do is to create the batches manually. Calling your dataset and then evaluating a conditional to see if the input should be added to the batch.