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