Uniqe id writing

Hi, I want to write the number like from 1001 to 1010 means tens in a one excel row, how can Ido this. As I am writing the data into an excel using Add Data Row and it’s writing from A1. like first my Name, Phone Number, I’d like that. But I want to write the data in the first column, Is it possible how can I write the value it should be uipath generated, I am not copying this value from somewhere. Please help
sorry for changes. Ex.

@RobertD @Palaniyappan

Can i have a view onthe xaml a screenshot if possible
Cheers @balkishan

1 Like

So you want your Row to look like
ID; Name; PhoneNumber; etc…

Why don’t you just add the column ID in A row before everything?

1 Like

If I will not add this, then I have to copy the data from this excel and paste in a new sheet where I have generated the number. Like this.

its already there well we can the change the place of id in add data row
{ID,Name,PhoneNumber}

Cheers @balkishan

Okay fine I want to write this random generated value like from 1001 to 1010, it’s depends on the max value in a loop. It should be in a order.
2. I want to copy the data of some row value and write in the above excel file, where I am writing the random value.

1 Like

You can do this @balkishan,

  1. Initialize the variable value as 1000
  2. Read the excel and store in data table.
  3. Create a new data table with columns ID, Name , Phone using Build Data Table activity
  4. Looping the data table using for each row, and incrementing the variable value (1000 + 1) inside the for each row, use add data row to the new data table build with ID, Name and Phone.
  5. Then write the data to another excel
2 Likes

Yes exactly, the above one will help you for the question you edited just

Here is the steps I follow bro. Use Add data row activity and then used the Write Range so directly I write the value.

Let the loop exists and all the data is added to data row. Then use write range activity after the for each row activity, so that your data table have all the data which you want to add.

@balkishan

As you are writing it inside, it will behave unappropriate

1 Like

Here I am not reading the excel, directly I create the Header using the Build Data Table and the use Add Data Row and then use the Activity Write Range. I have attached the screenshot above.

A bit confusing @balkishan,

Can you attach the files if possible?
Without looping how are you getting the values from the previous excel?

Or else you can write the values directly to excel which contains data using write cell activity bro…

1 Like

shared one to one please find bro.

Everything is good bro, what you need to do is …

  1. In this build table activity… Create a new column as ID in the starting as in the screenshot …

  1. Create and initialize a variable as 1000. Assume IDValue…
  2. Then while using add data row, increment the value using assign activity IDValue = IDValue +1
  3. Then in the add data row activity, Give the values as (You are doing everything right bro)
    image

After this, the change you need to do is :
Write the value of DTTable after the close Tab activity so that the entire data is build and writing after the sequence ending will fill the entire data into the datatable

3 Likes

Thanks @HareeshMR and @Palaniyappan It’s really as worked expected :slight_smile:

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.