I need a good expression to split this paragraph up (if possible).
Instead I would like a row per - item - starting with (1) or (2) etcโฆ Like this:
Solved! Go to Solution.
I think you need to do this:
*<<INDEX( SPLIT( [ITEM_LIST] , "*" ) , 2 )>>*
<<INDEX( SPLIT( INDEX( SPLIT( [ITEM_LIST] , "*" ) , 3 ) , "," ) , 1)>>
<<INDEX( SPLIT( [ITEM_LIST] , "," ) , 2 )>>
<<INDEX( SPLIT( [ITEM_LIST] , "," ) , 3 )>>
<<INDEX( SPLIT( [ITEM_LIST] , "," ) , 4 )>>
<<INDEX( SPLIT( [ITEM_LIST] , "," ) , 5 )>>
Start with this, in another thread with you:
I tried that. It didnโt give me row per row:
That is using the expression you had given me.
NOTE - i made sure it was two linesโฆ
The column receiving the result must of type LongText.
oh ok. It was โtextโ ill make the change and see what happens. Thanks again Steve, as always!
I changed โItem_Listโ to type LongText - it still gives exact same results.
Screenshots, please.
Expression in my Google Doc:
Result:
Table:
Hmmโฆ I honestly donโt know if that should work in a template. Iโve only ever used it within the app itself. You could try creating a virtual column with the SPLIT() expression as its app formula, the use that in your template rather than the SPLIT() expression.
ok. Thanks Steve. I used SUBSTITUTE - not SPLIT. Do you mean use Split() instead?
Whoops! Yes, I should have said SUBSTITUTE(). Sorry for the confusion.
I gotcha. So i tried it - same result. Could i just set up a bunch of SPLIT() expressions - and hopefully have enough to fill enough rows?
<<Index(SPLIT([Item_List],โ,โ),1)>>
etcโฆ
You could certainly try. Itโll be ugly.
ok. Thanks
It looks ok. But i have a question. How can i make the โRental Returnโ be at the top ONLY. Then each row follows under neath?
I tried and this is what i got - โ*Rental Returnโ - shows up twice?
I donโt know what your current template or expressions are.
Template:
So that top expression - is a little different because the data at the beginning has a โ*โ.
For example:
" * โRental Returnโ * " - Well you cant see - but that has **** on both sides of itโฆ
*Rental Return
occurs twice because both of your first two expressions produce it:
<<Index(SPLIT([ITEM_LIST], "* "), 1)>>
<<Index(SPLIT([ITEM_LIST], ","), 1)>>
How do I make Rental Return be the first line only. And then each line afterโฆ?
Also I thought the "* " was different than the ", "
Shouldnt it look at the " * " differently than ", "?
Meaning as two separate lines
Should it be:
<<Index(SPLIT([ITEM_LIST], "* "), 1)>>
<<Index(SPLIT([ITEM_LIST], โ,โ), 2)>>
Thereโs no easy way to do it. Your input isnโt well structured for the tools AppSheet provides. Iโm still looking at it, though.
It still looks pretty good:
But i just wish i could move that first row - After the โNoneโ downโฆ
Try replacing those first two with these:
<<INDEX([ITEM_LIST], "* ", 1)>>*
<<INDEX(SPLIT(INDEX(SPLIT([ITEM_LIST], ","), 1), "* ", 2)>>
I think i am missing a โ)โ in your second line?
Also in the first line - do i put the โ*โ at the end?
Yep, missing parenthesis. Corrected:
<<INDEX(SPLIT(INDEX(SPLIT([ITEM_LIST], ","), 1), "* "), 2)>>
The extra *
is to replace the one SPLIT() removes, so you get *Rental Return*
instead of *Rental Return
.
Ok. Let me try this. BTW - I wouldnโt have come close to what you have. Thanks so muchโฆ
It doesnt fire the workflow rule now. I am guessing the expression has an issue?
Eek! Another typo, this time in the first expression. Try this:
<<INDEX(SPLIT([ITEM_LIST], "* "), 1)>>*
ok. It runs now. But i donโt see the ", " forcing a new line, see image:
Shouldnโt those items (i circled) be a new row?
Oh wait - i just realized - it has the same data twice. So your first two rows are all i should be using? If so, how come it doesnt put each on a new row?
Itโs a problem with my second-line expression. Holdโฆ
I donโt see a problem with it, but letโs try this instead:
<<INDEX(SPLIT(INDEX(SPLIT([ITEM_LIST], "* "), 2), ","), 1)>>
It looks the same to me:
I will say this. You got the first part on the first line:
โRental Returnโ
Whoohoo!
Hmmmโฆ It works for me from Expression Assistant. Please paste the text of that entire rental return message into a reply so I can test with it.
the template? the result is an email.
No, the text the template is processing.
Rental Return (1) [000000183] 2006 16โ LOWBOY TRAILER - VIN # 5FVBU16296B008780 - PLATE #625327H ,(1) [000000272] 2012 16โ LOWBOY TRAILER - VIN # 17XFH1625C1026074 - PLATE # 72114N ,(1) [000050077] 4,000 PSI HOT WATER PRESSURE WASHER SKID ENGINE: D1005-1GN0859,(1) [0706-35] 4,000 PSI HOT WATER PRESSURE WASHER SKID ENGINE: D905-6A2663,(6) [R-2 HOSE 50FT] 50FT R-2 PRESSURE HOSE,(2) [TRIGGER GUN] TRIGGER GUN
That? That is the ACTUAL column value for [Item_List]
The first part โRental Returnโ has * on both sides - FYI
Thank!
The expressions appear to work correctly.
In your template, please remove all of the INDEX() expressions then add them back one by one, testing after each, until the output isnโt what you want. Then post a screenshot of the expressions in use and the output.
Ok - i took out the first 3 โindexโ and it wouldnt fire until this one was put back. However - still not putting each row by row:
Thanks Steve for all your help on this!
It does, but every time you use SPLIT(), you tell it to look at the entire original input list. The parts youโve already seen are still there in the original.
User | Count |
---|---|
38 | |
28 | |
27 | |
25 | |
9 |