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 / Extract data from drop...
Power Automate
Answered

Extract data from dropdown list on web application

(0) ShareShare
ReportReport
Posted on by 12

Hi All,

 

I'm trying to get a list of all the options in a dropdown of a web application. For example: this is a amazon site. I want to get the list & count of how many options are available in the highlighted dropdown using power automate.

 

sakhigarg_1-1645177398942.png

 

This list can be dynamic i.e. new options be added or old options can be deleted. My flow should be able to handle this and give exact list of option on that moment.

Is this possible to do using power automate desktop? Kindly help me find a solution of this. 

Thanks,

Sakhi Garg

 

 

I have the same question (0)
  • Henrik_M Profile Picture
    2,021 Super User 2024 Season 1 on at

    Yes.

    Use an Extract data from web page action. In its advanced settings, configure it like so:

    Henrik_M_0-1645181211288.png

     

  • Verified answer
    VJR Profile Picture
    7,635 on at

    Hi @sakhigarg 

     

    You can also use the approach suggested by @Henrik_M 

     

    Here is another option:

     

    - After running the process, the output is as follows.

    On the left hand shown is the the TextList variable which will have all the list of items.

    On the right hand side in the Count variable you have the count of items.

     

    VJR_1-1645183663192.png

     

     

    - Just copy paste the below code in your PAD editor to get the Flow like the above

     

    @@timestamp: '02/18/2022 10:45:30'
    @@source: 'Recorder'
    @@recordertype: 'Web'
    @@culture: 'en-US'
    WebAutomation.LaunchChrome Url: 'https://www.amazon.in/' BrowserInstance=> Browser
    WebAutomation.ExecuteJavascript BrowserInstance: Browser Javascript: $'''function ExecuteScript() 
    { 
    var output = \"\";
    var ddl = document.getElementById(\'searchDropdownBox\');
    var count = document.getElementById(\'searchDropdownBox\').length;
    for (i = 0; i < ddl .options.length; i++) 
    {
     if (i == ddl.options.length-1) //to exclude semicolon for last item
     {
     output = output + ddl .options[i].text;
     }
     else
     {
     output = output + ddl .options[i].text + \';\' ;
     }
    }
    //alert(count);
    return output ;
     }''' Result=> Result
    Text.SplitWithDelimiter Text: Result CustomDelimiter: $''';''' IsRegEx: False Result=> TextList
    WebAutomation.ExecuteJavascript BrowserInstance: Browser Javascript&colon; $'''function ExecuteScript() 
    { 
    
    var count = document.getElementById(\'searchDropdownBox\').length;
     
    return count;
    
     }''' Result=> Count

     

     

     

  • melaniez Profile Picture
    7 on at

    Hi, 

     

    The solutions you suggest seem complicated for a non-developer ! I hope Microsoft will add an activity like a "find children" to get all the items from a dropdown list... 

     

     

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 592

#2
Valantis Profile Picture

Valantis 340

#3
11manish Profile Picture

11manish 284

Last 30 days Overall leaderboard