web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Inconsistent behaviour...
Power Automate
Suggested Answer

Inconsistent behaviour running scripts through ExcelOnline

(1) ShareShare
ReportReport
Posted on by 10
 
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!
Categories:
I have the same question (0)
  • stampcoin Profile Picture
    5,153 Super User 2026 Season 1 on at
    I tested the script and the flow.
    Both work for me.
     
  • HP-05081517-0 Profile Picture
    10 on at
    Hi @stampcoin - yes, I have a business license. Please could you share the result of running the script in Power Automate?
     
    I am also running this same script, as well as other scripts, in other parts of the PA flow and it works perfectly fine with a single regex pattern. The problem seems to be with this iteration using multiple regex patterns only.
     
  • Suggested answer
    HP-05081517-0 Profile Picture
    10 on at
    Edit: I have now found the answer to this issue; the problem was that I had mistakenly used my generic regex script in the Power Automate flow instead of a more complex one that accepts an array of regex patterns. PEBCAK!
  • stampcoin Profile Picture
    5,153 Super User 2026 Season 1 on at
    Attached my result.
    have you tried to recreate the flow?( if you can ensure that everything is correct)
  • stampcoin Profile Picture
    5,153 Super User 2026 Season 1 on at
    I guess you made it. Please mark it as answered.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 959

#2
Valantis Profile Picture

Valantis 872

#3
Haque Profile Picture

Haque 589

Last 30 days Overall leaderboard