I need to insert data FROM an Excel onto a website. In one part I need to fill ALL the data of a particular row if the Account = 0kg. If not I ONLY need to fill in the data of 2 particular columns(Column1 and Column2) of the NEXT row and check again if Account = 0kg. Below are the steps:
Type Row(1) of DataTable(From excel to Website)
Check if Account = 0kg: (On website(UI Element))
If YES: Click “Close” → Type Into Row(2) of DataTable(From excel to Website)
If NO: Type into Row(2)(“Column 1”) AND Type into Row(2)(“Column 2”)
Check if Account = 0kg:
If YES: Click “Close” → Type Into Row(3) of DataTable(From excel to Website)
If N0: Type into Row(3)(“Column 1”) AND Type into Row(3)(“Column 2”)
Can someone please tell me how can I do this?
Should I use a For loop, a While loop, a While Do Loop, …
I used a for loop inside a for loop but I think everything is going berserk!
How do I update the Row number? For ex: Row(1), Row(2), Row(3)…
How can we update a row with a counter?“”
And @ [NIVED_NAMBIAR] helped me with the structure in this xaml file: Main.xaml (14.0 KB)
I tried it and it worked. But now I wanted to know if we could do it using Queues?
What can we change in the xaml file to make it work with queues?
For example: when working with Excel, it is easy to find Row(3)(“Column 1”) and Row(3)(“Column 2”). But how to do it with Queues?
As you’ve already sent data to orchestrator, now instead of reading data from excel, use get transaction item activity and store data in queue item type variable(say TSitem). If you can see your data in queue item specific content, then you can use assign activity and store the value TSitem.SpecificContent(“ItemNameAsInYourQueueItem”) to the variable data1, similar actions for data2. Now keep the remaning part of your workflow as it is.
Hope you understood. If you can share screenshot of your queue item, I can give more clear code.
You should use TSitem.SpecificContent(“ItemNameAsInYourQueueItem”).ToString only in the places where you have DataTable.Rows(count)(“Column1”).ToString and DataTable.Rows(count)(“Column2”).ToString. You don’t need to use count variable any more. Also instead of the conditon <count<dt1.Rows.Count> use . It’s also a good idea to update your transaction item status to successful or failed, using set transaction status activity, after your job is done.
Go through the courses “Variables, Data Types and Control Flow”, “Data Manipulation” and “RPA developer advanced learning plan” in UiPath academy, if you want to understand how to work with variables, data tables and queues.
Well, it is not going to be the same thing if I don’t use count.
There are places where I need to put the data of the Next Row of column 1 and 2 only and places where I need to put data of the enitre Row.
If I cannot use count, I cannot specify the SpecificContent each time manually.
The Set transaction thing is okay. But I need to use a Business Exception as the next row depends on the previous row, so if there is any problem, the robot should stop.
Then you should upload all the row data to transaction item. Now instead of storing specific content in data 1 and data 2 variables, store all the specific content one by one into an array or list(say currentArray). As soon as your job is done with this transaction , then store this currentArray into another array variable(say PreviousArray). For this first time, your PreviousArray can contain empty values. Now you have two arrays representing previousRow and currentRow. You can make use of these arrays to build your workflow. Please note that all your transaction items should be processed by single robot and if you like to set priority, then set same priority for every transaction item.
in the structure before we used a “WHILE” loop, and now we are using a Flowchart(for the Queues).
Can we change the structure before into a Flowchart type as well?