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 / Problem to build a sel...
Power Automate
Answered

Problem to build a selector

(0) ShareShare
ReportReport
Posted on by

Hello,

 

I need your help to find the good selector for my project.

 

Context:  I want to automatize the brand configuration for the sellers of a marketplace. For this project I need to give the authorization for each sellers on a list of brand (from a excel spreadsheet)

For example, for a seller ABCD (fake example I create to explain better the problem), I want to give him the authorization for the brand NIKE.   

 

YITOMATE_0-1684601140418.png

 

Problem If I search this seller , it give me two choices (Seller ABCD and seller ABCDEFG) . My goal is to find the good selector in order to click to the correct checkbox (that it to say  the one which contain the exact name of the seller “ABCD”).

 

Here is the selector to click to the checkbox associated to the first line :

table[Id="shopsAuthorizedToSell"] > tbody > tr > td > div > div > label > div[Class="mui-checkbox-icon"]

 

Here is the selector to click to the checkbox associated to the second line :

table[Id="shopsAuthorizedToSell"] > tbody > tr > td > div > div[Class="mui-checkbox checkbox"] > label > div:eq(1)

 

For both selectors, it works also without [Class="mui-checkbox checkbox"] which is apparently optional

 

Here is the selector where we can see the text associated

table[Id="shopsAuthorizedToSell"] > tbody > tr > td > div > span[Text="ABCD"]

 

I try this selector (in click link to a webpage ) but it doesn’t work :

table[Id="shopsAuthorizedToSell"] > tbody > tr > td > div > span[Text="ABCD"]~[Class="mui-checkbox-icon"]

 

Can you help me ?

I have the same question (0)
  • Nived_Nambiar Profile Picture
    18,129 Super User 2025 Season 2 on at

    Hi @Anonymous 

     

    Could you show me the html structure of the checkbox ?

     

    Right click on checkbox  and click inspect element 

     

     

  • Community Power Platform Member Profile Picture
    on at

    Hello @Nived_Nambiar 

     

    Thanks for you help. !

     

    Of course, here is the element of the checkbox : 

     

    <div class="mui-checkbox checkbox"><label title=""><input type="checkbox"><div class="mui-checkbox-icon"><span aria-hidden="true" class="fa fa-check mui-fa-primary"></span></div></label></div>

     

     
  • Community Power Platform Member Profile Picture
    on at

    Hello,

     

    I have tried this and it partially works : 
    #shopsAuthorizedToSell tbody tr:contains('XXXXXX') [Class="mui-checkbox-icon"]

     

    The problem is that if I use the selector mentioned below , it will also click to the seller ABCDEFG
    #shopsAuthorizedToSell tbody tr:contains('ABCDEF) [Class="mui-checkbox-icon"]

     

    I want that it contains exactly the same text. So if search "ABCDEF" it shouldn't click to the checkbox associated to seller "ABCDEFG"

     

    If needed here is the element of the text 

    <td role="cell" class="mui-datatable-simple-cell mui-datatable-simple-cell-specific mui-datatable-simple-cell mui-datatable-simple-cell-borderless mui-datatable-simple-cell-content-centered mui-datatable-simple-cell-compact" style="width: 100%;"><div class="mui-datatable-simple-cell-content mui-datatable-cell-text mui-datatable-cell-xs"><span class="mui-text">ABCDEFG</span></div></td>

     

    YITOMATE_0-1684684004174.png

     

  • Nived_Nambiar Profile Picture
    18,129 Super User 2025 Season 2 on at

    Hi @Anonymous 

     

    could you expand this part and share the screenshot ?

     

    Nived_Nambiar_0-1684722184566.png

     

     

  • Community Power Platform Member Profile Picture
    on at

    Hello @Nived_Nambiar ,

     

    Yes of course ! Thanks for your help.

     

  • Verified answer
    Nived_Nambiar Profile Picture
    18,129 Super User 2025 Season 2 on at

    Hi @Anonymous 

     

    CSS selectors and Jquery selectors has one limitation, it cannot detect element fully by text, although jquery can do it some extend using contains which won't be applicable in this case. 

     

    To make things work in your case, use the following logic.

     

    1. Scrap the table found after search and store the results in datatable, 

     

    2. Loop through row and check when the first value is equal to ABC 

     

    3. Check its index value, like at start of loop you can set index variable of integer with value =0 and increment it for every iteration, 

     

    4. I hope that the highlighted html component has index attribute whose value increases with every row 

    Nived_Nambiar_0-1684769048938.png

     

    So you can construct the below selector to be used in click action 

     

    tr[index="%index%"]>td:eq(0)

     

    where %index% represent the index of each row which gets incremented during every iteration.

     

     

    Hope the logic helps !

     

    Mark it as solution if it resolves your query !

     

  • Community Power Platform Member Profile Picture
    on at

    Hello @Nived_Nambiar ,

     

    Thank you for your help ! I follow your advice and it works.

    For those who want to know how I configure it concretely , here is the screenshot

     

    YITOMATE_0-1684941705529.png

    I had difficulties to find a way to have the row number and this post help me a lot !

    https://powerusers.microsoft.com/t5/Power-Automate-Desktop/Searching-through-datatable-to-find-value-and-then-provide-row/td-p/1809952

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 501 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 323 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard