How to write the values in excel sheet from web application

hi , i am handling one scenario , in which i need to read the value of every field and write it into spreadsheet with the corresponding name.



plz refer to screenshot , like in website for example i want to read the value of first field i.e customer legal name and then i need to paste that value in the inventory sheet in F column in 4th row corresponding to the same name i.e customer legal name similary every field.

  1. Read the excel which you shared and store it in dtInput variable.

  2. Once you have the data from site you want to write, use a for each row in datatable activity and place an if condition that checks currentRow(“OBM Field Name”).ToString.Contains(“Customer Legal Name”)

  3. If true then currentRow(“OBM Field Name”) = The data you saved for customer legal name.

  4. To make it generic, you can replace “Customer Legal Name” with a variable that stores the labels of the website

@Neha_Aggarwal1
->Build a datatable according to excel columns requirement.
->Scrap the fields through Get Text Activity in Different variables.
->use add data row activity, give datatable and give variables like this

{var1,var2,var3}

@Quenton_Wayne_Rebello how to store every field value from website? like u mentioned in 3 step

@raja.arslankhan but then i need to use multiple get text activity as i have to scrape almost 50 fields

You have to use get text to get the values from the website

@Neha_Aggarwal1 Yes if it is not datatable then definitely you will use multiple get text

@Quenton_Wayne_Rebello i need to get more than 50 field value so multiple get text i need to use

You can try data scraping, refer the below link UiPath Data Scraping (Web Page to Excel) - Tutorial - YouTube

can u explain 4th point , how to make it generic so that in one if condition only we can compare every field name

@raja.arslankhan

the value which i get from website i need to write in F column for example - customer legal name value from website i need to write it in 4TH row in F column.
how to do this?

@Neha_Aggarwal1 Then you can append value through append cell

@raja.arslankhan need to put the check also that if column OBM field name is contain as field name in website then it should write into that corresponding row

@Neha_Aggarwal1
Then You need to read this file and save it in DT.
Then put loop over it and inside it use if condition to check this.
Then you put assign activity and update value of desire column

Like when you use datascrape or get text, along with the inputted text you can get the labels. Eg: Customer Legal Name - Inputted Text.

This label can be inserted in an array and using a for each, you can iterate through the array and check if currentRow(“OBM Field Name”).ToString(currentItem) and then assign the value.

Note:- currentItem will be attained through using a for each loop where items will be the label array