This is the same question as this thread of yours from 2022 right?
@LN provided a link to a working example back then, did this not work for your use case?
You just have to choose whether you want to store all the details in the code (which will likely require a QR to be able to store it all), or only store a record ID in the barcode/QRcode and then use that to calculate in the values from a CSV / choice list / entity list to your questions.