For Each Ui Element download and rename pdfs files

I have an automation that extracts information and PDFS from a Public website using information from an excel sheet, see attached and see below steps.

1.URL - Welcome to MID :: provided by vPIC - MID
2. Type MFRID number from excel into Manufacturer ID Text BOX
3. Uncheck Part 566
4. Click Search
5. Select 100 from Show Entries Drop Down

Once the results have loaded, under the Org Name column there are hyperlinks to PDF Files, I need to click on each hyperlink and download the pdf and rename the pdf according to the information in the table, see naming convention below. The number of results can vary from 1 to over 100. I am taking the approach of using the for each UI element but not sure how to put it all together. Can somebody please advise and share a sample workflow for this process and how to also use it when there are multiple pages? I have been trying to figure this logic out all day with no luck. A sample workflow would be much appreciated.
sample.xlsx (8.3 KB)

Rename file Requirement:
Orgname_Letterdate_ManufacturerName_ModelYearFrom_ModelYearTo

To make this process even better I would also like to create a folder for each MFRID number. for example 955 would have a folder called 955 and all the PDF’S associated with that number would go to that folder, this would be a bonus.

get_href.xaml (7.2 KB)
You can use find children to get all the hyperlinks.
This xaml is a sample for your website, you can use chrome to try it.

Thanks for the reply but im using the for each ui element approach

can you provide a workflow to the above request?

anybody out there have a suggestion?

Hi,

Can you try the following sample? This uses TableExtraction instead of ForEachUiElement because we can get each pdf file directly using HTTP request activity.

Sample20230124-6L.zip (16.1 KB)

Regards,

Nice Dude, works great only have one more request the pdf file names need to be according to this picture


This is an awesome workflow you sent, never thought to use http request

HI,

How about the following?

System.IO.Path.Combine(folderPath,row("OrgName").ToString+"_"+row("LetterDate").ToString.Replace("/","-")+"_"+row("YearFrom").ToString+"_"+row("YearTo").ToString+".pdf")

Sample20230124-6Lv2.zip (16.2 KB)

Regards,

Yes this also works, im not sure if i mentioned this above but some results will bring up more then 100 results. MFRID 958 comes back with 142 results, anything over 100 results will have to navigate to the next page, anyway to solve this also?

Hi,

We can set MulitiPage mode in TableExtraction activity (wizard). Can you try the following?

Sample20230124-6Lv3.zip (17.7 KB)

Regards,

1 Like

where did you add the filename update in the workflow? its working i just dont see how you did that.

Hi,

where did you add the filename update in the workflow?

Can you check “Filename for response attachment” property, as the following?

Regards,

I have been working on this for a while now and I had a clunky version that was not working well but I was getting output. I never thought of using the HTTP and the files are downloading 100% faster then my workflow. This is a legit workflow you sent me and I really appreciate it. My automation is 1000% better now. Thank you!!! Can I reach out to you if i have any other automation issues?

Hi,

Yes, If you have any problem and cannot find its solution in the forum, please create a topic in this forum. Many experts will help you and the topic will help those who face same issue later.

Regards,

1 Like

Sounds good I learned something valuable today!

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.