Issue with split - Multiline text variable
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-08-2024 04:07 AM
Hi ,
I am trying to split multiline text variable in Business Rule with \n and space.
Trying with the below script. But it is not working.
Example Multi line variable = Test User1
User2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-08-2024 04:40 AM
Hi
fullName = fullNameSplit[1]; // Trying to take only the first line "Test User1" as a full name
Should be fullName = fullNameSplit[0];
if (fullNameSplit.length > 1)
{
fullName = fullNameSplit[1]; // Trying to take only the first line "Test User1" as a full name
/*THIS IS THE 2nd user - index starts with 0*/
}
var nameSplit = fullName.split(' '); // Trying to split the space from the first line
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-08-2024 05:08 AM
Earlier I tried with [0] only, but it didn't give the expected result. When I try print in log, it is coming in first place. I will try again with 0.
Thanks for your response.