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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Regex match in UI sele...
Power Automate
Unanswered

Regex match in UI selector not working

(0) ShareShare
ReportReport
Posted on by 55

Hello

 

The UI elements change depending on the situation.
*The numbers change randomly.

Ex)

form[Method="post"][Name="main"] > table > tbody > tr > td > font > input[Name="options[reportOptions][15][interests]"][Value="1"]
form[Method="post"][Name="main"] > table > tbody > tr > td > font > input[Name="options[reportOptions][296][interests]"][Value="1"]


So, I tried to modify the selector using the Regular Expression Match Operator as follows, but I am consistently encountering an error.

form[Method="post"][Name="main"] > table > tbody > tr > td > font > input[Name@="options\[reportOptions]\[\\d\+]\[interests]"][Value="1"]

 

I've tested it dozens of times to see if it's a special text problem, but it hasn't worked. I have no idea what the problem is.

Is there any mistake in what I did?

Best Regards.

I have the same question (0)
  • UshaJyothiKasibhotla Profile Picture
    203 Moderator on at

    Use parse text and insert the patten giving the input then that variable you need to pass in the selector.

     

    Hope this helps

    Usha

  • song_coach Profile Picture
    55 on at

    @UshaJyothi20 

    I tested it according to your advice.
    \d+ doesn't seem to apply.

     

    Case1
    1. Escape text for regular expression
    input : options[reportOptions][15][interests]
    output : EscapedText

    2. Ui element Selector
    form[Method="post"][Name="main"] > table > tbody > tr > td > font > input[Name="%EscapedText%"][Value="1"]

    3. Test Result
    Success

     

    Case2
    1. Escape text for regular expression
    input : options[reportOptions][/d+][interests]
    output : EscapedText

    2. Ui element Selector
    form[Method="post"][Name="main"] > table > tbody > tr > td > font > input[Name="%EscapedText%"][Value="1"]

    3. Test Result
    Fail

     

    Case3
    1. Escape text for regular expression
    input : options[reportOptions][/d+][interests]
    output : EscapedText

    2. Ui element Selector
    form[Method="post"][Name="main"] > table > tbody > tr > td > font > input[Name@="%EscapedText%"][Value="1"]

    3. Test Result
    Fail

     

    I need additional advice.

    Best Regards.

  • UshaJyothiKasibhotla Profile Picture
    203 Moderator on at

     variable should be without double quotes 

    form[Method="post"][Name="main"] > table > tbody > tr > td > font > input[Name=%EscapedText%][Value="1"]

    3. Test Result

  • song_coach Profile Picture
    55 on at

    @UshaJyothi20 

    Case4
    1. Escape text for regular expression
    input : options[reportOptions][15][interests]
    output : EscapedText

    2. Ui element Selector
    form[Method="post"][Name="main"] > table > tbody > tr > td > font > input[Name=%EscapedText%][Value="1"]

    3. Test Result
    Fail

     

    Case5
    1. Escape text for regular expression
    input : options[reportOptions][/d+][interests]
    output : EscapedText

    2. Ui element Selector
    form[Method="post"][Name="main"] > table > tbody > tr > td > font > input[Name=%EscapedText%][Value="1"]

    3. Test Result
    Fail

     

    Case6
    1. Escape text for regular expression
    input : options[reportOptions][15][interests]
    output : EscapedText

    2. Ui element Selector
    form[Method="post"][Name="main"] > table > tbody > tr > td > font > input[Name@=%EscapedText%][Value="1"]

    3. Test Result
    Fail

     

    When comparing case 1 and case 4 I think it's right to put in double quotes.
    Still don't know how to use /d+.

     

  • UshaJyothiKasibhotla Profile Picture
    203 Moderator on at

    Hi @song_coach  try this

    form[Method="post"][Name="main"] > table > tbody > tr > td > font > input[Name="options[reportOptions][%EscapedText%][interests]"][Value="1"]

     

    Hope this helps

    Usha

  • song_coach Profile Picture
    55 on at

    @UshaJyothi20 

    Case7
    1. Escape text for regular expression
    input : 15
    output : EscapedText

    2. Ui element Selector
    form[Method="post"][Name="main"] > table > tbody > tr > td > font > input[Name="options[reportOptions][%EscapedText%][interests]"][Value="1"]

    3. Test Result
    Success

     

    Case8
    1. Escape text for regular expression
    input : /d+
    output : EscapedText

    2. Ui element Selector
    form[Method="post"][Name="main"] > table > tbody > tr > td > font > input[Name="options[reportOptions][%EscapedText%][interests]"][Value="1"]

    3. Test Result
    Fail

     

    Case9
    1. Escape text for regular expression
    input : /d+
    output : EscapedText

    2. Ui element Selector
    form[Method="post"][Name="main"] > table > tbody > tr > td > font > input[Name@="options[reportOptions][%EscapedText%][interests]"][Value="1"]

    3. Test Result
    Fail

     

    Still don't know how to use /d+.

    Best Regards.

     

  • ldidu Profile Picture
    2 on at

    Check if the output/EscapedText is stored as a text or numerical value. I am not sure if this is relevant in this specific context though but it is worth a try. 

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard