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

Community site session details

Session Id : XsK1CmiBQnKDOVwQcHIYLF
Power Automate - Power Automate Desktop
Unanswered

Regex match in UI selector not working

Like (0) ShareShare
ReportReport
Posted on 17 Dec 2023 15:03:10 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)
  • ldidu Profile Picture
    2 on 31 Jan 2024 at 09:48:16
    Re: Regex match in UI selector not working

    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. 

  • song_coach Profile Picture
    55 on 19 Dec 2023 at 05:44:41
    Re: Regex match in UI selector not working

    @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.

     

  • UshaJyothiKasibhotla Profile Picture
    65 Moderator on 17 Dec 2023 at 17:30:12
    Re: Regex match in UI selector not working

    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 17 Dec 2023 at 17:25:14
    Re: Regex match in UI selector not working

    @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
    65 Moderator on 17 Dec 2023 at 17:10:01
    Re: Regex match in UI selector not working

     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 17 Dec 2023 at 16:27:11
    Re: Regex match in UI selector not working

    @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
    65 Moderator on 17 Dec 2023 at 15:55:34
    Re: Regex match in UI selector not working

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

     

    Hope this helps

    Usha

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Telen Wang – Community Spotlight

We are honored to recognize Telen Wang as our August 2025 Community…

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Tomac Profile Picture

Tomac 986 Moderator

#2
stampcoin Profile Picture

stampcoin 699 Super User 2025 Season 2

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 577 Super User 2025 Season 2

Loading complete