We have been using the Shopify pack and would like to use it to update certain product variant barcodes. I’ve created an example page of how the table looks when synced with Shopify:
We would like the barcode to look how it is in the New Barcode column. Originally I thought we could use the Position column as that’s natively brought in from Shopify, and that does work but only for products that don’t have an Option 2 (Versions).
On the original page, I added 3 new columns:
To count how many unique Option 1 (Name) there are for each product: thisTable.Filter(CurrentValue.Product=thisRow.Product).Option1.countunique()
To count how many unique Option 2 (Versions) for each product (and to correct to 1 if 0):
if(thisTable.Filter(CurrentValue.Product=thisRow.Product).Option2.countunique()=0,1,thisTable.Filter(CurrentValue.Product=thisRow.Product).Option2.countunique())
To create the list that would in theory go at the end of the barcode for each product:
Sequence(1, thisRow.UniqueVersions.ToNumber()).ForEach(CurrentValue.Let(v,
Sequence(1, thisRow.UniqueNames).ForEach((CurrentValue)))).ListCombine()
I assume I will need to make a button or another column, but honestly I’m very lost on where to go from here or if I’m even on the correct path. Thank you for any guidance!
with cutting out all the noise (extra columns, buttons etc) in mind, i would tackle this the simplest and easiest way with formulas and “Barcode“ column.
1. Count column - this is filtering the table to find how many of each barcode in table. Note Barcode = Barcode is CurrentValue Barcode = this row Barcode.
Order Within - where the row sits within the same barcode. First part is filtering table for same barcode (as in Count formula), then sorting it by the Row ID and lastly finding where the row fits within this.
Then to achieve the New Barcode format, i concatenated Barcode column with Order Within.
Please note to save on bloating i.e. columns, i condensed it into the column titled New Barcode ALL IN ONE. You would just need this column and the Row ID column for streamlined effect.