Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-11-2023 01:54 PM
Hi, if you were able to access the source and tidy up\remove the unnecessary '................ 'formatting it would be a lot cleaner. As an alternative to the regex solution, you will be able to use substring() and indexOf() to extract your values and I think this makes your intentions clearer to future users\developers.
var test = current.short_description;
var indexStart = test.indexOf('Employee Name');
var indexSize = test.indexOf(':', indexStart);
var indexEnd = test.indexOf('\n', indexStart);
var myString = test.substring(indexStart + (indexSize - indexStart), indexEnd).trim();
gs.info(myString);