Hi,
In Power Automate for Desktop, when you click on a link on a web page, you want a red framed <div> to appear when you place the pointer over the drop-down list, but instead of a <div>, only a <Select> is displayed. Do you know how to set it up?
Kind Regards,
Toru
Hi everyone,
Thank you very much for all your advice.
I tried out some advanced settings and was able to get the list contents by setting a CSS Selector.
I owe this to you all. I look forward to seeing you again.
Kind Regards,
Toru.
Hi Nathan-san,
I tried the follow-up you gave me and got the same results.
I'll use this as a reference. I'm very grateful.
Currently, I'm using the company's internal system to create a sample flow and considering whether it can be used for education.
Many people who use Power Automate Desktop don't know Javascript, so I'll be researching flows that are suitable for everyone and rolling them out to others.
Thank you very much.
Kind Regards,
Toru.
Hi @Toru-san !
Try using action 'Run Javascript function on web page'.
So I am trying to extract this:
I want all those drop down values in a list or something.
Here is an example of my flow:
You can use either of these JavaScript codes:
1)
function ExecuteScript() {
var titles = '';
var selectElement = document.getElementById('searchGranularity');
if (selectElement) {
var options = selectElement.getElementsByTagName('option');
for (var i = 0; i < options.length; i++) {
var title = options[i].getAttribute('title');
if (title) {
if (titles !== '') {
titles += ', ';
}
titles += title;
}
}
}
return titles;
}
2)
function ExecuteScript() {
var titlesArray = [];
var selectElement = document.getElementById('searchGranularity');
if (selectElement) {
var options = selectElement.getElementsByTagName('option');
for (var i = 0; i < options.length; i++) {
var title = options[i].getAttribute('title');
if (title) {
titlesArray.push(title);
}
}
}
return titlesArray.join(', ');
}
Result:
In this way, you can use this for any drop down boxes in any website. Just make sure to update the id value fitting to the id element of that select in that web page.
I hope this helps.
Hi @Toru-san ,
I would suggest to go through this url https://www.youtube.com/watch?v=QllyIdxm4H0 , hope this would solve the issue.
thanks,
if it resolves your query kindly mark it as solution and give kudos!
Hi Agnius-san,
Thank you for your reply.
I checked various websites and everyone seems to have a simple solution. However, I don't understand the procedure. Could you please explain it in detail?
Kind Regards,
Toru.
You need to do the extraction with the drop down list expanded in the browser, and target the individual values of the list, not the parent <select> element.
Hi AK88-san,
When selecting from the list, does the arrow in the image below need to change to "Table" instead of "Select" in order to select? I've checked a number of sites, and this is the only difference.
Kind Regards,
Toru.
Hi AK88-san,
When I operate it, it looks like the image below.
It seems that the list is not selected during the operation process.
Kind Regards,
Toru.
Hi @Toru-san ,
Please let me know how you're extracting. I'll mention below the steps to do the extraction using the same action.
1. Hover your mouse to the position where the elements need to be chosen.
2. Kindly give right click and choose 'Extract Element Value' , then choose the attribute needed.
2. if you need a table, choose the next row from the list, this will be automatically forming as a table.
Kindly check and let us know.
thanks,
if this resolves your query kindly mark it as solution and give kudos!
Hi AK88-san,
Thank you for your reply.
I have been using "Extract data from web pages" since before making this post, and it looks like the image below. There are some differences from the image you replied to. I would like to isolate the problem. Looking at the image below, does it seem like there is something I'm doing wrong?
Kind Regards,
Toru.