web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id : 28yDnvzl1MLXvGIPOC+kfw
Power Automate - Power Automate Desktop
Answered

Extract data from dropdown list on web application

Like (0) ShareShare
ReportReport
Posted on 18 Feb 2022 09:49:05 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

 

 

  • melaniez Profile Picture
    7 on 28 Jun 2022 at 13:21:43
    Re: Extract data from dropdown list on web application

    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... 

     

     

  • Verified answer
    VJR Profile Picture
    7,635 on 18 Feb 2022 at 11:30:45
    Re: Extract data from dropdown list on web application

    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

     

     

     

  • Henrik_M Profile Picture
    2,006 Super User 2024 Season 1 on 18 Feb 2022 at 10:47:16
    Re: Extract data from dropdown list on web application

    Yes.

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

    Henrik_M_0-1645181211288.png

     

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

Announcing our 2025 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for…

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 497 Super User 2025 Season 2

#2
David_MA Profile Picture

David_MA 436 Super User 2025 Season 2

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 244 Super User 2025 Season 2