Read only cells in excel


#1

Hi all,

My bot has to iterate through the excel file and after iterating through first row it is populating it in webpage.
Now if there are more than one row in excel than rather than doing Checkout from the page it is clicking Continue which Brings the BOT to the eligibility page.Now on the eligibility page bot has to read the data from the second row in the excel as it contains different CTN number than the previous one.
The requirement is that the BOT should only read the CTN number column from the excel and when it comes to the eligibility page it should write the CTN number present in second row of CTN number column.
Currently bot is writing the previous CTN number which has already been passed and it is giving error.
Example.
name CTN
ABC 23456
SDW 23417

Currently BOt is writing first row data only when it comes to eligibility page but i want it to write second row data.

Please suggest.


#2

@anil5 can you please help in this?


#3

How are you accessing the data? do you loop through each row?


#4

yes in the beginning it is looping…
but when it writes first time and click “continue shopping” it comes to check page where it is again writing first row data but i want it to write second row data


#5

What is your assign for that data item?
i.e. DT.Rows(0).Item("CTN) will give you first row
DT.Rows(1).Item(“CTN”) will give you second row.


#6

if there are more than two rows and we want the bot to read data one by one of each row and if the there is any duplicacy it is throwing the box to write diff CTN number and then it has to read next row and then write the data into webpage till it reaches the last row in the excel.how will that be done.please help
kind regards


#7

Implement a count - rowCounter = 0 at start of the loop, after completing first row increment the counter - rowCounter = rowCounter + 1.

Then in DT.Rows(rowCounter).Item(“CTN”)

have a decision at end of loop
rowCounter = DT.Rows.Count - 1

If True - Exit Loop
Else - go back to start and work next row


#8

i am unable to understand this.can you please provide a sample xaml of it.


#9

in a workflow -

  • Assign - rowCounter = 0

  • Start

  • //Do Work

    • DT.Rows(rowCounter).Item(“CTN”)
  • rowCounter = rowCounter + 1.

  • Decision - rowCounter = DT.Rows.Count - 1

  • If True

    • Exit
  • Else

    • go to Start

#10

if i am using this rows.item(“CTN”) then it is not breaking it into the format 123-456-456 ,it is directly writing it as 1234456456 because of which the error comes


#11

You didnt’ state you required a specific format or provide an actual example.
You can simple use string manipulation to insert ‘-’ if that is required.