Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Power Automate Desktop
Suggested answer

How to Check Multiple Checkboxes with a Single "Set Check Box State" Action?

(1) ShareShare
ReportReport
Posted on by 46
Hi everyone,

I’m using the "Set check box state on web page" action to select checkboxes, but I need to check all "Temperature Sensor" checkboxes at once.
Is there a way to do this with just one action, or do I need separate actions for each checkbox?


Thanks for your help!

Categories:
  • Suggested answer
    Riyaz_riz11 Profile Picture
    2,818 Super User 2025 Season 1 on at
    How to Check Multiple Checkboxes with a Single "Set Check Box State" Action?
    Hi
     
    Use JavaScript to Check All "Temperature Sensor" Checkboxes
    Insert a "Run JavaScript function on web page" action.
    Use the following JavaScript code:
    document.querySelectorAll('input[type="checkbox"]').forEach(function(checkbox) {
        if (checkbox.labels && checkbox.labels[0].innerText.includes("Temperature Sensor")) {
            checkbox.checked = true;
        }
    });
    Explanation:
    querySelectorAll('input[type="checkbox"]'): Selects all checkboxes.
    checkbox.labels[0].innerText.includes("Temperature Sensor"): Checks if the label contains the text "Temperature Sensor".
    checkbox.checked = true: Checks the checkbox.
    Alternative
    If the checkboxes don’t have labels, but instead have a name, id, or class attribute that includes "TemperatureSensor", you can modify the selector:
    document.querySelectorAll('input[type="checkbox"][name*="TemperatureSensor"]').forEach(cb => cb.checked = true);

    If I have answered your question, please mark it as the preferred solution. If you like my response, please give it a Thumbs Up.
    Regards,
    Riyaz
  • Suggested answer
    VishnuReddy1997 Profile Picture
    2,358 Super User 2025 Season 1 on at
    How to Check Multiple Checkboxes with a Single "Set Check Box State" Action?
     
    You can achieve this by these 2 below methods.
     
    1. Use a loop with UI elements:
    • First, identify all checkboxes related to "Temperature Sensor" on the page.
    • Use a loop to iterate through each matching checkbox element and set its state to checked.
      This requires capturing all those checkboxes as separate UI elements or by indexing them if they share similar selectors.
    2.  Inject JavaScript (if allowed):
    If you can run JavaScript on the page via Power Automate's "Run JavaScript function on web page" action, you could run a script that finds all checkboxes with a certain attribute or label and checks them all at once.

     
    Example query: document.querySelectorAll('input[type="checkbox"][data-label="Temperature Sensor"]').forEach(cb => cb.checked = true);
     
    (Note:- if you got your solution you can mark as solution and gives kudos)
     
    Thanks & Regards
    Vishnu Reddy

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

Michael Gernaey – Community Spotlight

We are honored to recognize Michael Gernaey as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard >