Hi Guys,
so far I managed to download some data from SAP, wrote it in Excel and uploaded one column with InvoiceNumbers to a Datatable in UIPath.
Now I would like to perform for each invoicenumber of the data table some steps:
on a website (basically open website search number, and download the invoice) & save&rename the pdffile with the respective invoice number .
go to a sap transaction open the invoicenumber and add the invoice pdf…
Do that with all existing invoicenumbers of the datatable
I started with a for each activity but, it put all the invoices together in the website…
Now i dont really know how to continue.
Thanks for any hints how to continue
Best,
Markus
Hiba_B
(Hiba Beldi)
March 17, 2021, 3:52pm
2
Hi @Markus3003 !
Would you mind sharing with us your xaml file ? So that we could understand what is blocking you
Hi @Hiba_B ,
thanks for your answer! Not that much to share so far.
Adjust Excel Data.xaml (23.1 KB)
Hiba_B
(Hiba Beldi)
March 17, 2021, 4:11pm
4
Alright, so what you are actually trying to type into is the whole datatable as a string, that’s why you are not getting the result expected.
What you really need is to type into only rows elements of the column called InvoiceNumbers, so you should do like this:
2 Likes
Yes that looks good, thank you
Any idea how I can save/rename each pdf with the corresponding invoicenumber?
Hi @Markus3003
You can use move file activitiy for this
Regards
Nived N
Happy Automation
1 Like
Hiba_B
(Hiba Beldi)
March 17, 2021, 4:33pm
7
Sure ! How do you trigger the saving of the file ? Is it through a button ?
To rename a file already locally saved in your computer, you can use “Move File”:
1 Like
Guys you are great!
Thank you!!
1 Like
Yes exactly, with clicking on the save button…
I think/hope it should work with your describtion, i will try!
Thank you Hiba
1 Like
Hiba_B
(Hiba Beldi)
March 17, 2021, 4:52pm
10
Oh then you should directly write the right file name, without using move file activity !
In the Dateiname, you should type into:
folder path + "\" + row("InvoiceNumbers").tostring+".pdf"
and that’s it
1 Like
Hi @Markus3003
It’s better to use move file activitiy rather than going for UI Automation
Regards
Nived N
Happy Automation
Gosh, could you also tell me whats the best way to download the pdf from web?
UiPath is not recognizing the printer or download button in my case.
Thank you
@Markus3003 - You can use Either UiAutomation or Http request to download the pdfs…
Yameso
(Jakub Swiderski)
March 17, 2021, 7:40pm
14
You can also use Send hotkey activity with shortcut: Ctrl+Shift+s and then type into path with file name with extension. Last would be enter key for saving.
But API surely would be much faster.
Steinar
(Steinar)
March 17, 2021, 7:58pm
15
If not downloading through API, you can click the download symbol and make sure to toggle the “Ask where to save each file before downloading” in Chrome download settings so the Save As window is shown.
Hiba_B
(Hiba Beldi)
March 17, 2021, 8:12pm
16
Exactly, and to illustrate it you use Send Hotkey activity:
Beware of your selector, so that it fits different pdf
@Yameso would you mind explaining in details the API way ? I am interested to learn about it
Yameso
(Jakub Swiderski)
March 17, 2021, 8:20pm
17
I would love to but Im still begginer in that case
Here is connected topics:
Just some doubts:
Invoking this code I must to “exclude” automatically the HTTP request activity?
I suppose that red words are customizable parts. In my case the attachment name is a variable, not the extension.
Are there some other variables to declare?
Thanks
Hello i am trying to send a pdf file with https request, it dont give me any error but the file aint uploaded, do anyone know the body syntax and head syntax for uploading a pdf file also if you know the approach for a image upload aswell i would be very happy
Thanks in advance
But Im sure, some forum experts would help you
1 Like
Steinar
(Steinar)
March 17, 2021, 9:25pm
19
Try with this example from “http://www.africau.edu/images/default/sample.pdf”
Activity: Http Request
Properties:
@Markus3003
Hey Markus,
To get best out of this particular type of automation, i would suggest you to use Dispatcher and Performer concept.
Dispatcher will add your invoice numbers to queue.
Download data from SAP
Add data to queue
And performer will come into picture.
Performer
Get transaction item (one invoice number at time)
Download PDF and perform operations on SAP
update progress of invoice
Move to next invoice
This way it is easy to track, debug and avoid unnecessary loops and conditions.
To rename a file, use file system, this will help you FileSystem.RenameFile("C:\Test.txt", "SecondTest.txt")
To download any pdf file you can use
Either
Ctlr + P that will give you option to print file and save it as pdf
or use
Ctrl + S that will save pdf
Hi @Hiba_B ,
Can you see what I’m doing wrong? I get the error “row is no member of string” Thank you