341
Views
3
Comments
Solved
Best way to remove some characters while assigning that value in server action
Question
Application Type
Reactive

Hi ,

I just want to know the best way to remove some characters from a value while assigning to a server action input parameter. Say for example, I have a attribute which stores email address with text as [Manager Email]: example@example.com ; [Employee Email]: example@example.com. To send the email I need to remove the text [Manager Email]: and [Employee Email]: but I don't know the exact position of these texts. What should be the best way to accomplish this.

Is it by using Substring, index or length builtinaction. Or is there any better way? 

2020-11-13 07-48-15
Khuong Truong
Solution

Hi Aditya,

Then you can do it twice as first one for [Employee Email]: and do replace [Manager Email]: (in the first result) by "" as well. 

For example: Replace(Replace("[Employee Email]: example@email.com" ,"[Employee Email]: ", ""), "[Manager Email]:", "")

Regards,

Khuong 

2020-11-13 07-48-15
Khuong Truong

Hi Aditya,

If you want to remove a certain text like "[Employee Email]:" or "[Manager Email]:" then just simply use Replace() built-in function to replace that chars by an empty string (""). 

For example: Replace("[Employee Email]: example@email.com" ,"[Employee Email]: ", "").

Edit: refer to this https://success.outsystems.com/Documentation/11/Reference/OutSystems_Language/Logic/Built-in_Functions/Text#Replace

Regards,

Khuong

2022-12-03 12-19-54
Aditya C

Hi @Khuong Truong ,

Replace for "[Employee Email]:" with "" is fine. But what if I have "[Manager Email]:" in same Value. And need to replace both by ""?

2020-11-13 07-48-15
Khuong Truong
Solution

Hi Aditya,

Then you can do it twice as first one for [Employee Email]: and do replace [Manager Email]: (in the first result) by "" as well. 

For example: Replace(Replace("[Employee Email]: example@email.com" ,"[Employee Email]: ", ""), "[Manager Email]:", "")

Regards,

Khuong 

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.