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 / Choosing a web element...
Power Automate
Answered

Choosing a web element based on a string

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi Experts,

I am at a loss and would greatly appreciate some advice.

 

My process goes as following:

I'm determining a string for the current month and then I would like to select the folder to the corresponding month.

How do I select the web element which contains the string for "October"? And how do I make sure this process will work for every other month aswell?

Edited.png

 

 

I have the same question (0)
  • Verified answer
    MattJimison Profile Picture
    579 Most Valuable Professional on at

    Edit: I just realized you're in a web browser instead of Windows Explorer but you'd still use the exact same process as below, you'd just select a folder in your UI and adjust it similar to how I've outlined the below.

     

    If you add a UI Element and select one of the folders in Windows Explorer (make sure to select the list item as you hover over the folders), you'll see similar parent and item selectors to the below (I have a folder called 2022 with child folders inside for each month and I've selected January).

     

    Parent (Windows Explorer):

    :desktop > window[Name="2022"][Process="explorer"]

     

    Item (one of the folders):
    > pane[Class="ShellTabWindowClass"][Name="2022"] > pane[Class="DUIViewWndClassName"] > pane[Class="DUIListView"][Id="listview"] > list[Class="UIItemsView"][Name="Items View"] > listitem[Class="UIItem"][Name="January"]

     

    The key to solving your particular dilemma is that you have more text after the name of the month, so your selector needs to be a "starts with" on the Name, instead of being an "equals". You do that by using ^= instead of = on the Name selector.

     

     

    This selector would select any folder that starts with January, regardless of what comes after it:

    > pane[Class="ShellTabWindowClass"][Name="2022"] > pane[Class="DUIViewWndClassName"] > pane[Class="DUIListView"][Id="listview"] > list[Class="UIItemsView"][Name="Items View"] > listitem[Class="UIItem"][Name^="January"]

     

    The next thing you need to do is just to take these findings and insert a variable into your actual selector, that you're going to set before you call it, to the month you want to pick, so that you get the folder you need.

     

    Example Variable:
    %MonthToSelect%  ('January')

     

    Example Selector: (you're going to edit the UI element you picked earlier when you clicked on a list item and you're going to just edit its value)

    > pane[Class="ShellTabWindowClass"][Name="2022"] > pane[Class="DUIViewWndClassName"] > pane[Class="DUIListView"][Id="listview"] > list[Class="UIItemsView"][Name="Items View"] > listitem[Class="UIItem"][Name^="%MonthToSelect%"]

     

    Hope this helped!

     


    Find this post helpful? Please mark it as the solution and/or provide kudos so that it will help others in the future.


    Cheers,
    Matt

  • VJR Profile Picture
    7,635 on at

    Good detailed explanation by Matt.

     

    Just a few tips and pointers on building a custom/dynamic selector or using variables in selectors.

     

    https://learn.microsoft.com/en-us/power-automate/desktop-flows/build-custom-selectors

     

    https://powerusers.microsoft.com/t5/Power-Automate-Desktop/Dynamic-Selector-variable-in-selector-in-Desktop-Automation/td-p/716646

     

     

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 252 Super User 2026 Season 1

#2
11manish Profile Picture

11manish 169

#3
Haque Profile Picture

Haque 154

Last 30 days Overall leaderboard