Upload attachment to invoice in SAP

I have a list of invoices in SAP.
The file name of the attachment contains the invoice number.

How do I design the bot such that it can upload the correct attachment to each invoice using the invoice number as the identifier?

Hi @StanKarl,

Greetings from the UiPath Forum

To achieve this, you can use the UiPath “Get File Name” activity to extract the file name from the attachment. You can then use the “Filter” activity to compare the file name with the invoice number from the list of invoices in SAP. Finally, you can use the “Upload File” activity to upload the attachment to the corresponding invoice.


Hi @StanKarl ,

We should be able to extract the Invoice Number from the file name either using String/Regex manipulation. For further help on this, if a format of the file name that will be used is provided we could suggest the approach required.

Also, To understand how to upload the corresponding Invoice for the invoice number in SAP, we would also require to know some more details of how the UI and how the operation is done manually after the Invoice is identified.

Hi Arpan,

Thanks for the response.

The format of the attachment file name contains 00.
I intend to store the list of attachment files in MS Team folder.

In SAP, there will have a list of invoices.
The RPA Bot is supposed to read the invoice number in SAP to pick the correct attachment and upload it to the specific invoice with the same invoice number.

Hope this clarifies.

Thank you.

Thank you RajKumar Durai.

If there are 10 attachments, after the Bot extracts the file name from the 1st attachment, how do I design the bot to read the next attachment?

Toward the 10th attachment, how do I design the bot to stop given that there is no more attachment?

Thank you.