Text message forward but remove last 20 characters

Bexier

New member
I am using the template SMSCODE. It starts with everything I need except I can't figure out how to write the regex to strip the message of the last 20 characters.

Is this possible?
 

tanutanu

Well-known member
If 20 is the fixed legth, Text manipulation -> Substrings action is easier.
Check whole the string length and put it in an int variable first, then omit the last 20 characters.
 

Attachments

  • Screenshot_20211029-002225.png
    Screenshot_20211029-002225.png
    135.1 KB · Views: 24
  • Screenshot_20211029-002242.png
    Screenshot_20211029-002242.png
    134.4 KB · Views: 24
  • Like
Reactions: 420

Bexier

New member
Thanks for the quick reply!!

I'm sorry but I can't seem to get it to work.

1. I get a text from 12345 (auto text)

2. Set Int var (this is where I'm having trouble)

3. Text manipulation: substring

4. Save to new var

5. Send sms (new var)

Thanks
 

tanutanu

Well-known member
Thanks for the quick reply!!

I'm sorry but I can't seem to get it to work.

1. I get a text from 12345 (auto text)

2. Set Int var (this is where I'm having trouble)

3. Text manipulation: substring

4. Save to new var

5. Send sms (new var)

Thanks
Just do it:)
 

Attachments

  • IMG_20211029_235509.jpg
    IMG_20211029_235509.jpg
    173 KB · Views: 10
  • IMG_20211029_235608.jpg
    IMG_20211029_235608.jpg
    160.3 KB · Views: 10
  • IMG_20211029_235748.jpg
    IMG_20211029_235748.jpg
    132.9 KB · Views: 9
  • IMG_20211029_235836.jpg
    IMG_20211029_235836.jpg
    124.7 KB · Views: 10

Dm114

Well-known member
Thanks for the quick reply!!

I'm sorry but I can't seem to get it to work.

1. I get a text from 12345 (auto text)

2. Set Int var (this is where I'm having trouble)

3. Text manipulation: substring

4. Save to new var

5. Send sms (new var)

Thanks
Text manipulation only works on string variables. If the value comes from an integer or decimal variable, set it in a string variable first. Then, if needed, you could store the extracted numerical string back to an integer variable using Magic text [strval=your_string_variable]
 
Top