Extract email from sc_task work notes
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-01-2025 12:36 PM
Hello community, I'm trying to create a flow to automate emails. In the "to" field of the action available through Service Now, I managed to create a script to extract the "description" field. However, I need to do the same for "work notes", but I was unsuccessful. I need help and creativity on how to perform this task.
Below is the script I created to extract the email in the "to" field.
// Get the description of the trigger record
var description = fd_data.trigger.current.description;
// Regex to extract email
var emailRegex = /[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}/;
// Search by email
var match = description.match(emailRegex);
// Returns the found email or empty string
if (match) {
return match[0];
} else {
return '';
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-01-2025 08:42 PM
HI @eduardosant ,
What exactly is your issue, are you not able to get the work notes from flow script ?
Thanks,
Yaswanth.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-02-2025 12:41 PM
Hello yASWANTHkURRE, I'm not able to transform work notes into the "string" type.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-05-2025 05:37 AM
Hello @eduardosant ,
Are you using "fd_data.trigger.current.work_notes.toString()"? for all the work notes on current record
or you only need the recently added worknotes?
Thanks,
Yaswanth