- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-20-2024 08:31 PM
Hi All,
I'm creating a flow designer and the trigger is inbound email.
My problem is I'm not getting the correct location. I created an action so that I can use it for look up records of Location. As you can see I set the Site that will serve as the location.
Please help me to resolve this as I was stuck 😞
Please see the screenshot below
Email Sample:
Site: 123 Site Location
Result that I get:
Location: 465 Site Location
Action
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-20-2024 10:14 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-20-2024 08:52 PM
Hi @sailor_moon
Can you try the following email parsing logic-
(function execute(inputs, outputs) {
var emailBody = inputs.emailBody; // Assuming you have an input variable emailBody which contains the body of the email
var locationPattern = /Site:\s*(.+)/i;
var locationMatch = emailBody.match(locationPattern);
if (locationMatch && locationMatch.length > 1) {
var location = locationMatch[1].trim();
outputs.location = location;
} else {
outputs.error = "Location not found in email."; // If location information is not found, set an error message
}
})(inputs, outputs);
Please mark my answer helpful and correct.
Regards,
Amit
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-20-2024 10:07 PM
Hi @Amit,
I'm still getting the incorrect location 😞
This is the sample email that I created while this is the incident created
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-20-2024 10:14 PM