How to trigger the process whenever the item added to queue

We are trying to automate the Product ordering process in our procurement website based on the information from the ticket created by the user using Uipath.

Whenever the user create the ticket in our ticket tool the information like Productame,Qty,EmailAddress…etc will be extracted from ticket and stored in the shared path as a CSV file

Here is our requirement:—

Whenever the CSV file has been placed in shared path. We want to read the data from the CSV file and “add to queue “in orchestrator and The Product Order process should be trigger once the items have been added to the queue

Please guide how to achieve this requirement

Hi @Sathish_Kumar_S

Read the data from CSV and add it to the queue using activities such as read range, for each row, and add to queue item.

Please refer the below document, refer the queue trigger,

Thanks

Hi Prasath,
My requirement is whenever the CSV file placed in the shared path folder.

I want to start the workflow automatically to add the items from CSV to queue and start the ordering process.

How to achieve this ?

@Sathish_Kumar_S I don’t know if we can start the process when file is placed, though if the robot is running and if the file is created or changed we can start the specific process.

Please refer below

https://docs.uipath.com/activities/docs/file-change-trigger-v-2

Thanks

Is it possible trigger the process if we send the CSV as attachment in email to particular mailbox? then the value from attached CSV file will be added to queue and start the ordering process?

@Sathish_Kumar_S

You create two separate processes called Dispatcher and Performer.

Dispatcher - To check any file uploaded into shared folder or not. If yes read the file and add it to Queue. Schedule this process for every 5 mins.

Performer - To read items from the queue and process it. Create Queue Trigger for this. So that it will trigger immediately when items added to the queue.

@Sathish_Kumar_S as an alternative we can do like this also,

Create a process which will check the mail( particular subject) and will be scheduled for every 30 or 1 hour.

If the mail has came it will start the process else it will finish.

Thanks

Which activity i need to add to check any file uploaded into shared folder or not?

Below is the sample project which I have created to test and I was able to start the process manually from orchestrator / Uipath Assistance . It is working fine.

Which activity i need to add if the file is placed or not in shared drive?

Dispatcher :

image.png

Performer :

image.png

Main:

image.png

@Sathish_Kumar_S

           arrFiles [ ] = Directory.GetFiles("Shared Drive Path")

And check arrFiles.Count > 0
Then Files exists
Else input files not exists

I know you’re stating that a CSV is generated and you want to monitor for these files to kick start the processing of the files… If you have the capability to create the CSV; can you also interact with the UiPath Orchestrator API?

If so you could do one of a few things

  • Add the needed data as a QueueItem (/odata/Queues/UiPathODataSvc.AddQueueItem) and launch a process by configuring a Queue Trigger
  • Bulk Add Queue Items if your CSV can contain multiple records to process ( ​/odata​/Queues​/UiPathODataSvc.BulkAddQueueItems)
  • Start a job passing the data as input arguments (/odata/Jobs/UiPath.Server.Configuration.OData.StartJobs)

https://docs.uipath.com/orchestrator/reference/api-references

https://docs.uipath.com/orchestrator/reference/retrieving-specific-transactions#adding-a-queue-item

Do i have to select the Excel file from shared path in read range which contains information to order the product in portal? and schedule the queue to run for every 5 minutes ?

@Sathish_Kumar_S

Yes if file exists then read the file using Read Range activity and add items to Queue. Once it is done then move the file to different to location or delete it if is not required.

@Sathish_Kumar_S

Schedule the dispatcher for every 5 mins.

Performer will be based on Queue Trigger.

1 Like

1.How do i make sure the values from excel file is added to queue
2. Which activity i need to add to move the file to different folder and where i have to place that activity? Because same time multiple user’s might create ticket to order product in procurement portal and we might have multiple CSV/Excel file in that shared path.

This is my sample project… I am invoking dispatcher and performer workflows in Main workflow and published to orcherstrator

How do i Schedule the dispatcher for every 5 mins.

and Performer on Queue Trigger.

@Sathish_Kumar_S

I can see you implemented this step already. Are you facing any issues with it ?

And also put the Add to Queue Item activity in Retry Scope activity. It will retry if it is failed to add item to Queue.

Use Move File activity to move the file and place this activity after For Each Row activity.

Add to queue item is working fine… i thought we need to verify if the items are added to queue before moving the file to different folder

Since you suggested to add move file activity after for each row… then we don’t need to worry about this

@Sathish_Kumar_S

You need to create two separate processes. One is for Dispatcher and other is for Perfomer.

Are you using Orchestrator ? If yes then Deploy both Dispatcher and Performer processes into Orchestrator by using Publish option in UiPath Studio. And create process using that package.

Dispatcher - Navigate to Triggers page in Orchestrator and select Time based. And then select Minutes option and enter 5 under Minutes field.

May I know how many BOTS are you planning to use for this process ?

As of now i am testing it on community edition and once it is success. I will use companies enterprise license and will decide about BOTS… As of now we are planning to implement this automation for only one location. We may get only 3-5 tickets per day for procurement process. How many BOTS we required ?

Is it possible to add each new tickets data in new row in one EXCEL/CSV file instead of creating new excel/CSV file for each ticket and how to avoid adding the OLD data from excel sheet to queue and create duplicate PR in procurement portal?