How can I download a file which contains a specific date in the file name?

dwreports_qn1
How can I download a file which contains a specific date in the file name?

I am trying to download a specific file from the directory web URL.
I search for each record (e.g LF0427-01) from the excel file. There’s a list of records with reports dated today (or specific date).
I want uipath to right-click and Save the file name (using Contains a specific date)
Since the file name (e.g LF0427_LF0427-01_1_2021-10-28T01_00_03.pdf) contains a date “2021-10-28”. I want uipath to only click on that file. I think I may need the help for the following:
a) How to use contains in uipath
b) Command uipath to click on specific links only

Thank you and any help is appreciated!

For both together we can use CLICK TEXT activity where we can mention the date value you have as text so that bot will click on that

To do a right click we got an option in property panel of that activity manes click type

Cheers @Betta_path

@Palaniyappan thank you for your prompt reply. I understand the click type activity part but how do i write in the click type activity to search the text which Contains a specific date?

Usually there are two ways to click a text

  1. One with normal click activity where along the selector of that click activity we need to create a variable for the attribute which has the file name
    Usually it will be aaname attribute which holds the text part

So we need to create a variable and replace that selector attribute value with that variable

Now we can pass our value of date to that variable so that click activity will on the text which has that aaname in it

  1. Second one is with CLICK TEXT activity where simply we can pass the date value as string so that the bot will look for that text in region of scope you have indicated
    And bot will click on that text

Cheers @Betta_path

@Palaniyappan i tried your method but i still don’t get the result i want. As the file name contains a long string, i want to use “contains” function which contains the specific date.

i get this error message:
RemoteException wrapping UiPath.Core.Activities.TextNotFoundException: Text was not found
at UiPath.Core.Activities.ScopeActivity.OnFaulted(NativeActivityFaultContext faultContext, Exception propagatedException, ActivityInstance propagatedFrom)
at System.Activities.Runtime.FaultCallbackWrapper.Invoke(NativeActivityFaultContext faultContext, Exception propagatedException, ActivityInstance propagatedFrom)
at System.Activities.Runtime.FaultCallbackWrapper.FaultWorkItem.Execute(ActivityExecutor executor, BookmarkManager bookmarkManager)

Hi,

Can you try wildcard or regex for selector as the following steps?

First indicate element from Click activity. Part of selector will be as follows:

<webctrl aaname='LF0427_LF0427-01_1_2021-10-28T01_00_03.pdf' tag='A' />

then, simply modify it to

<webctrl aaname='*2021-10-28*' tag='A' />

If need more complex condition, we can also use regex selector.

Regards,

1 Like

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