How to Click Multiple attachement file in Website

Hello,
I am creating a Bot where i want to click each attachment
like this - Rameshwar Varma - 06-Jan-2025 at 10h34 MC844_01_01_PK-MDX-PMI_Teams.xlsm Mar Cura - 06-Jan-2025 at 04h51 OBS_PMI_StatementOfRequirements_GLOBAL_v1.8_PK-MDX-PMI.xlsx"
This is the text that i get from get text. There is 2 files that are-
1-MC844_01_01_PK-MDX-PMI_Teams.xlsm
2- OBS_PMI_StatementOfRequirements_GLOBAL_v1.8_PK-MDX-PMI.xlsx
I want to click these file one by one and also there are some scenario where file name contain 2 file extension like
Global.1…xlsx-shangania redesigning.xlsx … How can i solve this

Please help me as i am new to UiPath

@HELZMOTH_BJ

try using for each ui element and click inside that using currentelement

in for each indicate the attachments

cheers

I have used that but it is not working

Hi @HELZMOTH_BJ

To click each attachment, extract file names using a regex like \S+(\.[a-zA-Z]{2,4})+(\-[a-zA-Z0-9]+)*\.(xlsm|xlsx|pdf) from the text. Then, iterate over the file names in a For Each loop and use the Click activity with a dynamic selector that includes the file name for each attachment.

@HELZMOTH_BJ

If your data looks like as data table then use extract datatable activity to extract all the file names,
then use for each range to loop all items inside loop use click activity to click on respective action and one more thing you can get all of your data in data table. you can get your file items from data table itself

Does it can be used for multiple Dot like this one- OBS_PMI_StatementOfRequirements_GLOBAL_v1.8_PK-MDX-PMI.xlsx

And also does it work for this case also - Global.1…xlsx-shangania redesigning.xlsx

@HELZMOTH_BJ,

Explain, what’s the error you are getting and how you tried to implement.

Yes. Pls share the error screenshot for more clarifications.

I am using this regex System.Text.RegularExpressions.Regex.Matches(filename, “\d{1,2}h\d{2}\s+([^\t\n\r]+?.(msg|xlsx|pdf|jpg|jpeg|png|zip|7zip|txt|doc|docx|))”) but in this case “OBS_PMI_StatementOfRequirements_GLOBAL_v1.8_PK-MDX-PMI.xlsx”
I got the result “OBS_PMI_StatementOfRequirements_GLOBAL_v1.8” this fails the my selector as it not able to click this. and also this in this case “Global.1…xlsx-shangania redesigning.xlsx” my selector fails


in fileName2 = i use this regex