Hi! I have a process where I want to upload files from a folder on a website one by one for further use. The way I am trying to automate this is: Click on the upload button, (opens the folder window), click on the first file, click open, – then I proceed with the rest of the steps not relevant here --, then I am using a Do While to repeat the process in which I click on the first file again and then send hotkey of a Down arrow as many times as the loop counter. So in other words, first time it uploads the first file and we are fine. Second time I want it to click on the first file again, go Down one time, so it’s on the second file, and open that. Third time the arrow should go down twice so that it’s at the third file, and open that. But this hasn’t been working, it keeps choosing the first file all the time and I don’t know how to move on to the next one and then the next one etc with every round. Any help here? I hope this makes sense!
welcome to the forum
You description is understandleable and we do interpretate it as the flow does mimic an user click flow.
Send hot key requires in some cases that the target of the activity requires to be set on the select file dialog for a controlled sending the hot key.
You can do following:
- rewire the selector from the send hot key to the area displaying the files
- readin the files with a directory.GetFiles(… - returning a string array with the filepaths
- iterate over the array with the file paths with a for each
- implement the steps for opening the file upload dialog
- use the current looped filepath and enter it into the field, which is picking up the selected file info
In case of ot is not working on the first go, just share with us some screenshots. thanks
Thank you! I ended up solving the issue with a For Each file in Directory.GetFile(…) and then I passed the file.ToString in a TypeInto activity. So pretty much close to your second suggestion. It is so exciting learning more on UiPath and thank you for your fast response.
Perfect. So just do your final testing and mark the solving post as solution once you have done. Others can benefit from this. Thanks
Hello Marina. Are you all right? I have a process similar to yours. On a website the robot clicks a button (Choose File), then I use Type Into to write the path of the folder with the files. From that moment on I am having difficulty because I do not know how to do it. The robot needs to click on the first file (each file has a different name), click on “Open” or double click on the file, and then click on the “UPLOAD” button when the Upload is finished, it must again click on the “Choose File” button. I believe your flow is the same, so could you share the main file here?
Olá Marina. Tudo bem? Estou com um processo semelhante ao seu. Em um Website o robô clica em um botão (Escolher Arquivo), depois uso Type Into para escrever o caminho da pasta com os arquivos. A partir desse momento estou com dificuldade pois não sei como fazer. O robô precisa clicar no primeiro arquivo (cada arquivo tem um nome diferente), clicar em “Abrir” ou duplo clique no arquivo, e depois clicar no botão “UPLOAD” quando terminar o Upload, dever novamente clicar no botão "Escolher Arquivo). Acredito que seu fluxo seja igual, sendo assim você poderia compartilhar aqui o arquivo main ?