I strucked here to return non null value to call my api. Please tell me how it will be work to call api for once, Thank you.

```
        barcodes.forEach {
            if (!it.displayValue.isNullOrEmpty()) {
                barCode = it.displayValue!!
            }   
        }
        if (barCode.isNotEmpty()) {
            viewModel.callMyAPI(barCode)
            stop()
        }

```