RPAChallenge Invoice Extraction

Hello. I’m trying to do(https://rpachallengeocr.azurewebsites.net/) with REFramework but a bit different way. I wanted to download all the invoices and then read them and create an excel file that includes (No, ID, Due Date, Company Name, Date, SubTotal, Tax %, Total).

I extracted the table from the site and added it in a data table as dt_ExtractedData . Then, I’ve uploaded the table in a queue with URL reference. Then I wanted to open all URLs in process and downloaded them. Besides I wanted to read the data and then add all info in a data table that I created in init as dt_Output.

But while I’m using REFramework, I keep getting a problem. I’m probably doing something wrong. After I get the data from the queue with Get Transaction Item, I’m using URLs to download but while it is downloading, it uses same transactions again and again randomly and it doesn’t end. when i check the queue, I see some of them successful but some of them in progress and it always keeps working. What am I doing wrong?

Another question, while downloading after “save as”, it waits too much and I don’t know why. I have put delay but it’s in “do while” and it waits too much here.

Thank you so much in advance. I’ll try to add ocr workflows meanwhile and combine the output data in dt_OutputData.

RPAChallengeOCR.zip (3.0 MB)

Please answer following questions to help you better

  1. In your case - After reading data table - Are you looping through the data table and add queue item one after the other including the link to extract invoice? Ideally this should be the approach which will result in 4 transaction items if the data table contains 4 rows. Status of all items would be New. Please confirm on this point.

  2. While processing the request - Bot will fetch one item at a time. You can use debug activity to see the status changing in Queue item. Whichever item is getting processed - the status will be In Progress. In the processing stage - you can download the invoice. Read the values and add / append to an excel.

  3. After adding to excel - Status should be successful

PLease see if your BOT is designed as above / working as above details. Let us know if there are any differences

Hi @sharazkm32

  1. After I extract table from (https://rpachallengeocr.azurewebsites.net/), I’m adding all rows in a queue like this.

I’m adding 12 rows like this, there are 12 invoices info and I’m taking all of them thanks to next button in the site.

You can see I’m correctly getting the info from the site and I’m adding them into the queue.

Then I’m not changing anything in “Get Transaction Data”. I’m only adding workflows in “Process Transaction” in “Invoke Process Workflow”

But in that time, it always processes same transactions again and again and it doesn’t end.

I didn’t read invoices to add excel yet. 1st I wanted to download all invoices in a folder, then in the 2nd workflow I was planning to add all the info in an excel file but it failed while downloading.

I’ve translated all comments to English and shared the document again.

RPAChallengeOCR.zip (3.0 MB)

@sharazkm32 any further info do you need? I’m trying to learn UiPath, so I’m not good at REFramework as well. I’m trying to do everything well but when it doesn’t work, it’s hard to find what is wrong. I tried to explain what I did in the project and shared all project to show everything clearly.

@Sekoleyte

  1. You can use bulk add queue item activiity instead of loop and add queue item…for reference just create a column with Reference name and it would take that value as reference…for details look here https://docs.uipath.com/ACTIVITIES/other/latest/workflow/bulk-add-queue-items..but what you did is also correct
  2. in process.xaml you need not do get transaction item again that happens in get transaction data state already…already the data would be present in in_TransactionItem argument which is of queueitem type basically the output of get transaction item from get transaction data xaml…and this is the reason you are seeing few in progress left becasue the items you get in process.xaml using get transaction item will not be closed with status…so remove it and use in_Transactionitem

to start with these are the issues I see…and for save as may be the selector might be wrong or is having few attributes which are dynamic…check the same

cheers

Loading part looks fine as per your logs

One thing you need to notice is that - While doing performer - If there are any errors - By default the queue item will be retried for 3 times. This could be one of the reason why you feel like the same item is getting processed again. To confirm that - I would suggest you to change the retry number as 0 and run the process.

To modify retry count, Go to orchestrator–> Your project folder–> Queue–> Edit your queue

Uncheck all and make the count as 0

Next check you could do is to run the performer. It should atleast pick different queue items one after the other.

Lets fix this first and check on the status of queue item.

Also kindly share full log after the performer run to do a detailed analysis

Hello. As I told I didn’t change anything in Get Transaction Data state. I just used Get Transaction Item in Process Transaction state. And here I added all my workflows in Invoke Process Workflow as you’ve seen in the SS. Do I have to change something in Get Transaction Data state. I was thinking I don’t need to change anything here.

Did you tried the steps I have mentioned in the above comment?

I’ve already created my queue like this

Send me the full log then

If you have the flexibility to delete the queue - please delete and add new with the same name without retry option enabled

Run the full process- See how many queue records are added. Note the count

Put a message box of unique reference after getting the transaction item and see the process flow. Whenever message box is displayed - see the status of item in queue after refreshing

Share your observations and a full log

I had run the project and waited till all the invoices downloaded, luckily it didn’t last too much but as I told earlier, it chooses randomly and processes it and it doesn’t stop even if all of them processed. You can see the log below:

At the end I stopped the project run.

@Sekoleyte

In process.xaml you need not add get transaction item again…No changes in get transaction data…just use in_Transactionitem values instead of get transaction item in process.xaml

cheers

1 Like

Hi

As suggested by @Anil_G

Kindly remove this Get Transaction Item. Instead - you check the arguments. You can use the output of this activity to Argument In_transactionitem

@Anil_G and @sharazkm32

I removed Get Transaction Item activity and run the project but still it gets same URLs again and again

@Sekoleyte

as per log message the urls are different as I see 3 and 8…so the issue might be something else

please run in debug and use step into and try to check the variables and screen to know the differences

cheers

This is my last run log and you can see the orchestrator as well. 12, 1, 8, 11… last items which added queue in orchestrator. And you can see the same in logs as well.

But the problem why the status is always “New” Why it doesn’t change successful even if log says it’s successful?

You can see the my workflow template that I use in Process and in other workflows. is the problem about it?

@Sekoleyte

Ideally there should have been max 12 items but there are many more than that…so looks like add queue item is running everytime may be …check the same…and if you have given retry in queue then failed items will be added back…check the old items if the status has changed

as said please run in debug…use breakpoints and check the queue ui and variables to unerstand

cheers

This is my last run, stopped it manually. There are 2 times 9, but there is not 2 and 6 in that time. it always gets random items from queue not in order.

To identify the issue - Delete the queue and add a fresh queue

In the INIT - limit to add only one item

put message boxes at every major step and see whether the status is changing … Instead of running end to end - kindly debug and see where exactly the issue is

Make sure retry item is disabled

Thank you @sharazkm32 and @Anil_G it looks it was a mistake to put Get Transaction Item in Process. And because we had a lot of extra transaction item that waits as New in queue, it was always using them. After removing old queue and adding new one worked. Look at that! Eventually I could reach End Process :slight_smile:

2 Likes