Remove All Numbers

YGY
Silver 1
Silver 1

Hoping someone can help me. Iโ€™ trying to remove all numbers and โ€œ-โ€ from a text field:

So from this:
5-A,4-C,3-R

To This:
A,C,R

Thanks.

Solved Solved
0 7 1,194
1 ACCEPTED SOLUTION

Assuming your text string pattern remains identical as you confirmed , with AppSheet expressions, you could try

SUBSTITUTE(EXTRACTMENTIONS(SUBSTITUTE(โ€œ5-A,4-C,3-Rโ€,"-","@")),"@","")

Will give following result ( with space before and after commas)

A , C , R

Alternatively, a still longish expression
SUBSTITUTE(SUBSTITUTE(EXTRACTMENTIONS(SUBSTITUTE(โ€œ2-A,3-B,5-Rโ€,"-","@")),"@","")," , โ€œ,โ€,")

Will give following result ( without space before and after commas as your given example shows)

A,C,R

Edit: Minor edits in description.

View solution in original post

7 REPLIES 7

Could you please update if
5-A,4-C,3-R is one text string or a combination of 3 different texts?

Also is the pattern one digit Number-Alphabet a consistent one or can it change

5-A,4-C,3-R is one text string and the pattern will always be the same.

Thanks @Suvrutt_Gurjar

Thereโ€™s really no good way to do this with AppSheet: itโ€™s possible but itโ€™s super ugly and very delicate. If youโ€™re using Google Sheets and can tolerate a sync to get the result, add another column to the spreadsheet with a formula of:

=REGEXREPLACE(A2, "\d+-", "")

replacing A2 with the spreadsheet column containing the original value. Copy the formula down for all existing rows of the spreadsheet, then regenerate the tableโ€™s columns in the app to pick up the new spreadsheet column. The new app columnโ€™s configuration should include a Spreadsheet formula setting that looks similar to (but slightly different than) the formula above. This new column will receive the modified original value after a new original value is entered and the app syncs.

Unless REGEXREPLACE() isnโ€™t supportedโ€ฆ Hmmโ€ฆ

Thanks for your idea @Steve Steve, Iโ€™ll give it a try as I think syncing might actually be a good thing in this case.

Assuming your text string pattern remains identical as you confirmed , with AppSheet expressions, you could try

SUBSTITUTE(EXTRACTMENTIONS(SUBSTITUTE(โ€œ5-A,4-C,3-Rโ€,"-","@")),"@","")

Will give following result ( with space before and after commas)

A , C , R

Alternatively, a still longish expression
SUBSTITUTE(SUBSTITUTE(EXTRACTMENTIONS(SUBSTITUTE(โ€œ2-A,3-B,5-Rโ€,"-","@")),"@","")," , โ€œ,โ€,")

Will give following result ( without space before and after commas as your given example shows)

A,C,R

Edit: Minor edits in description.

Excellent, thank you @Suvrutt_Gurjar that worked.

Nicely done!

Top Labels in this Space