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 / Loop Browser Element b...
Power Automate
Unanswered

Loop Browser Element based on it's Attribute

(1) ShareShare
ReportReport
Posted on by 24
Can you please advise how would you do a loop that goes through each tbody element and checks if class attribute IS NOT equal to "day dayOff"?
 
Exampletbody > class[NOT EQUAL "day dayOff"]
 
I have the same question (0)
  • Suggested answer
    Nived_Nambiar Profile Picture
    18,129 Super User 2025 Season 2 on at
    Hi, 
     
    One logic i could think of is - you can use following selector in format 
     
    tbody[class!="day dayOff"]
     
    Now the logic on how to achieve this kind of looping UI Elements would be like as below
     
    1. Use Javascript function on webpage to count the number of elements equal to xpath //tbody[@class!="day dayOff"] using belos function code.
    function ExecuteScript() { 
    var xpathResult = document.evaluate('//tbody[@class!="day dayOff"]', document, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);
      
      // Return the number of elements found
      return xpathResult.snapshotLength;
    
    
    }
    like below
     
    the output of this function would be number of ui elements whose selectors would have tbody with class attribute not equal to day dayOff.
     
    Now loop through the result variable after converting to a number format using convert text to number action and then using loop action as shown below
     
    I am not sure what you are trying to do with each UI Elements having tbody tag containing class attribute not equal to day dayOff.- but here i have used a click action which will click on each ui element having selector as 
     
    tbody[class!="day dayOff"]:eq(%LoopIndex%)
     
     
     
    Hope this idea helps !
    Thanks & Regards,
    Nived N 
    LinkedIn: Nived N's LinkedIn
    YouTube: Nived N's YouTube Channel
    Blog: Nived Nambiar's Blogs
     Found my answer helpful? Please consider marking it as the solution!
     Your appreciation keeps me motivated. Thank you!

     

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