Auto sku id appsheet

Hello, how are you all

can I create a unique ID formula that generates sku for each item.

 

For example: I have a table called (Items)

Columns called (category), (sub category), (color), 

example: (office) (Desk) ( Brown) 

I want to have an sku that concatenate  one or two letter of first category and add a number. like this

 

office = Of

Desk= D

Brown = Br (If two colors start with B... take different letter) for example for brown take B and for black take k.

 

so new sku will be

of-d-b-001

Solved Solved
0 10 504
1 ACCEPTED SOLUTION

See  Concatenate values with a delimiter: How to simula... - Google Cloud Community . For example:

SUBSTITUTE(
    TEXT(
      LIST(
        [Category], 
        [Subcategory], 
        [Color], 
        UNIQUEID()
        )
      ), 
    " , ", 
    "-"
)

In the draft expression, you can substitute each column reference with a more detailed expression to return just the abbreviation that you want. For example:

LEFT([Category], 2)

SWITCH([Color], "Brown", "br", "Black", "bk", LEFT([Color], 1))

View solution in original post

10 REPLIES 10

Ja mit dem Ausdruck VERKETTEN() 

Thank you very much

can I use CONCATENATE with uniqueid

would you mind write the structure of expression 

@dbaum 

@Tommy62 

See  Concatenate values with a delimiter: How to simula... - Google Cloud Community . For example:

SUBSTITUTE(
    TEXT(
      LIST(
        [Category], 
        [Subcategory], 
        [Color], 
        UNIQUEID()
        )
      ), 
    " , ", 
    "-"
)

In the draft expression, you can substitute each column reference with a more detailed expression to return just the abbreviation that you want. For example:

LEFT([Category], 2)

SWITCH([Color], "Brown", "br", "Black", "bk", LEFT([Color], 1))

@dbaum  Perfect thank you very much

In my Google sheets I have cetain number for sku.

 

for example: chairs start with 001 to 100

tables start with 101 to 200

Pillows and beds start with 201 to 299 and so on.

 

but in appsheet unique id only 8 fields like this (935f1559)

can I make it shorter? and can I make it in sequence like what I did in my sheet

It's generally possible to represent all your required logic in an AppSheet expression that generates an identification code. However, beware designing dependencies on serial numbers. You may be better off assigning each item a randomly generated UNIQUEID in one column and a logic-based SKU in another column. That's especially the case if you need duplicate SKUs (e.g., "can I also have same sku generated").

Thanks indeed @dbaum 

I thought of doing it like so:

In Canada stock table add two columns - one for uniqueid and one for logic. and create one sku of both columns. 

In UAE table I also add logic column - but the id column will ref and get ids from Canada table id column. 

>> this way same item in Canada and in the UAE will have the same sku.

-----

or I may also have different sku for each country. This will be easier...  I will see. 

Schaue doch mal dieses kurze Erklärvideo an, wie man automatisch fortlaufende Nummern zur einer Kategorie erhält. In Kategorien fortlaufende Nummern generieren . Wäre auch eine Lösungsansatz zur Erstellung eines neuen Artikels.

Consider collapsing everything into a single stock table that includes a column for location. Then, use slices to distinguish stock by country.

@dbaum 

can I also have same sku generated for two stock tables.

for instant I sell the same chair in Toronto and in Dubai 

14_WK_Sheru_0045_tif_271130fb0f.jpg