splitting a text in a field from a web screen

Hi Team,

I have a field with Phone number which captures both phone number with extn.

Now when I want to edit the details in the screen it is showing the Phone Number field with extn, I want to split this and show the extn to another filed called phone extension.

Here I am using a traditional web and I am using the same screen for inserting and editing the details

while inserting I am using separate fields for phone number and extn and the database is storing the phone number and extn as a single field.

but while editing the details the Phone Number field is showing the phone number with extn, I want to split the content and add the  Phone extn field in the edit screen. Please help me how to achieve this.

Thanks in advance.

Regards,

Madhu

Hi, friend!

Have you tried to use the String_Split action?

You can use it with a structure to hold phone and extn values.

Lenon Manhães wrote:

Hi, friend!

Have you tried to use the String_Split action?

You can use it with a structure to hold phone and extn values.

 

 Hi Lenon,


I could not find this server action (string_split) in my app (Traditional web app). But I have done this with a code snippet. Thanks for the information.

Regards,

Madhu

Hi Madhu,

Maybe you need add a dependencies, example:


In the dependencies, there are many very useful actions that you may need.


Regards.

Madhu,

String_Split function will help you to create a list of text, based on a delimiter.

For example if you have a string like:

1,2,3,4

And use this string in String_Split with comma as a delimiter it will return a list with:

1

2

3

4


I think this is not your user case here.

What I think you need is Substr() function, see:

With it you will be able to get for example just the 2 first digits and after the rest of your string.


You can then use it like this for example:

Substr(Text,0,2) //This would be the first 2 digits, for example extern code
+
Substr(Text,2,Length(Text)) //This would be the rest of your telephone


Hope it helps,

Cheers and Regards,
RR :)

Hi Madhu,

You can use Input mask to achieve this.

This component will give nice look to your application page and easy store functionality.

https://www.outsystems.com/forge/component-overview/647/custom-input-masks

Hope it will help :)

Good Day

Regards,

Samiksha