Hi King Java,
As discussed, to achieve your requirement, you can follow the steps below in your workflow:
- Outlook Trigger: Use the "When a new email arrives (V3)" trigger. This will monitor all incoming emails in a specified folder within your inbox, based on the conditions you set.
- Execute JavaScript Code Action: Use the "Execute JavaScript Code" action with the following regex expression and JavaScript code to extract any
http
orhttps
links present in the email body. Here’s the inline JavaScript code you can use:
var text = /https?://\S+/g;
var links = workflowContext.trigger.outputs.body.body.replace(/https://nam06.safelinks.protection.outlook.com[^"]+/g, '');
var result = links.match(text);
if (result && result[0]) {
result[0] = result[0].replace(/"$/, '');
}
return result[0];
If this answers your query, do click Accept Answer
and Yes
for was this answer helpful. And, if you have any further query do let us know.