Hello,
When scanning a barcode, I would like to create a collection with the ItemNumber (the barcode value) and the Quantity. The Quantity is stored in a dataverse table column, where the column name is our customer number.
The table looks like this:
ItemNumber | CU-XX-XXXXX
A1B3C3 | 5000
This is working code that creates the collection with the correct quantity:
Collect(colScannedItems,{ItemNumber: Self.Text, Quantity: ShowColumns(Search('SC OrderScans',Self.Text,"cr501_itemnumber"),"cr501_cuxxxxxxxx")});SetFocus(Self);
Now this creates a nested table in the Quantity column of the colScannedItems collection. I have no use of this table, and would rather have the value instead.
I believe LookUp can do this for me, so we tried this:
Collect(colScannedItems,{ItemNumber: Self.Text, Quantity: LookUp('SC OrderScans',ItemNumber = Self.Text,'CU-XX-XXXXXX')});SetFocus(Self);
This however still creates the collection with a nested table, and it doesn't return the Quantity i'm looking for.
I'm at a loss, this should be simple. I just want a collection with an item number and a quantity, no nested tables.
Thanks!

Report
All responses (
Answers (