Split and Concatenate List Items in Two Seperate Columns

Hi All,

There may be an easy solution to this but I haven't come up with it.   I have two comma delimited fields that come in via Shopify for my orders.   The first is line items of the order, the second is quantities of each line item.

Screen Shot 2022-04-19 at 7.16.49 PM.png

There can be 4-5 line items in an order and quantities of each line item can be between 1-5.

I would like to split the two columns above and then concatenate like-for-like.  So in the example above I need a new virtual column that reads:

1X Hibiscus Vodka Cooler - Ketel One / 375ml Bottle - 8 & 1X Cocktails,Watermelon Basil Margarita - 375ml / 6 Cocktails

 

Any help is appreciated!!!

0 2 362
2 REPLIES 2

I could think of two ways to do this, both requiring normal (not virtual columns):

1. Use Recursive Actions. This is within AppSheet.

2. Use Apps Script array command on your sheet. This is outside AppSheet.

I figured it out! INDEX() is what I was looking for:

 

IF(

CONTAINS([Line Items Title], ","),

CONCATENATE(CONCATENATE(INDEX([Line Items QTY Split],1),"X ",INDEX([Line Items Split],1)
),

"

WITH

",

CONCATENATE(INDEX([Line Items QTY Split],2),"X ",INDEX([Line Items Split],2))
)
,
CONCATENATE([Line Items Quantity],"X ", [Line Items Title])
)

Top Labels in this Space