Hi there, I'm using Power Automate to run a script in ExcelOnline which allows me to use regex. The flow runs when an email arrives in an inbox. The script takes a string to search (in this case, the body of an email), an array of regex patterns, and regex flags to implement.
Here is the script:
When I run this script in ExcelOnline, it works perfectly and returns the expected result. However, calling the script in Power Automate returns no result at all.
The parameters I'm using are:
- The body of the email, or for testing something simple like 'Please contact the landlord: Jane Smith.'
- The following array regex patterns: ["landlord:(.*)[.]", "landlord -(.*)[.]", "landlord –(.*)[.]"]
- The regex flags: gi (global and ignore case)
Here's the full result of running this script in Power Automate, showing the empty result under 'body':
And proof that the incoming email contains text that matches the first regex pattern:
And evidence that the script runs correctly when tested in ExcelOnline:
Any assistance or suggestions would be highly appreciated!