How is your experience with the OutSystems Community?
23
Views
5
Comments
Solved
Name split
Question

Hi All,

I have below requirement

 Name provided in Form:  ALL ARMYS LTDA 

Then in API call - Name 1 : ALL ARMYS LTDA 

Name 2 : Empty 

Name 3 : Empty 

Name 4 : Empty 

 


Example2 : 

Name provided in Form:  Ã–ZBEY HİJYENİK ÜRÜNLERİ SANAYİ TİCARET A.Åž. Then in API call 

Name 1 : ÖZBEY HİJYENİK ÜRÜNLERİ SANAYİ 

Name 2 : TİCARET A.Åž. 

Name 3 : Empty 

Name 4 : Empty 

 

If the maximum number of characters (35) is reached in the middle of a word, the logic should revert to the previous separator, which is a space. This means that the segment will not be split within a word; instead, it will only be separated at the last complete word before the character limit is reached. As a result, each Name field will always contain whole words, and no word will be cut off in the process. 

If No space and the name is more than 35 chars then allow user to put notification

Can anyone please suggest ,


2026-07-23 14-34-51
Nuno Reis
 
MVP
Solution

Hello.

The mostly likely place where you want to split a string like this is to send to an external system 

Here is a way to do it in OutSystems as a server action:


SplitName.oml
UserImage.jpg
Preeti zade

Hello Nuno,

Thank you very much for your reply and suggestion.

Regards


UserImage.jpg
Preeti zade

Hello Nuno,

unable to debug,Can you please suggest

2019-01-07 16-04-16
Siya
 
MVP

@Preeti zade : The logic for your requirement is as below

  1. Take the full name from the form.
  2. Trim extra spaces.
  3. Check whether the name is longer than 35 characters.
  4. If it is 35 characters or less, put the full value in Name 1.
  5. If it is more than 35 characters, do not cut exactly at character 35 if that is in the middle of a word.
  6. Instead, go backwards from character 35 and find the previous space.
  7. Split the name at that space.
  8. Put the first part into Name 1.
  9. Continue the same process for Name 2, Name 3, and Name 4.
  10. Any unused name fields should be sent as empty.

Attached is an implementation using  JS (AI generated) . You may implement the same in Server side too following the above algorithm.

namesplit.txt
2026-07-23 14-34-51
Nuno Reis
 
MVP
Solution

Hello.

The mostly likely place where you want to split a string like this is to send to an external system 

Here is a way to do it in OutSystems as a server action:


SplitName.oml
UserImage.jpg
Preeti zade

Hello Nuno,

Thank you very much for your reply and suggestion.

Regards


UserImage.jpg
Preeti zade

Hello Nuno,

unable to debug,Can you please suggest

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