Pass data to a particular column in the excel sheet

@ClaytonM
I am checking for a validation for a From (while passing multiple data using for each loop)and after i get the validation message’s,i am storing that to “createPageValid” variable which is of object type .

Need help for the below two points:
while execution:

  1. How to write a data to a particular column in excel.
  2. want check “createPageValid” contains data. if data is there then i want to write that data to a specific column in excel ,if not then write “validation message’s are wrong”

point 2 → when i use IF condition ,“createPageValid” is an object type ,so it cannot convert that to a boolean condition (not sure how to proceed further).


Hi @karthikeyuan_subrama

For those two steps

  1. You can use write cell activity to write the data to a particular column. You can give the range accurate to the cell you want to write.
  2. You can use the condition as if(createPageField <> ’ ’ or createPageField = null), in then field, you can give the message box and in else condition you can place the write cell activity mentioned in 1.

Hope this helps.

Regards,
Hareesh

1 Like

@HareeshMR Step 1: i would be passing multiple data’s from excel and i would be getting various validation messages based on the data passed.

Data is passed with For Each row activity.

Will the "write cell activity "start writing the data from J2 and continue further to J3,J4 and so on.?


Solution you provided for point 1 ,i have applied ,but It’s start over writing the same cell .

Initialize another variable something as Count and give the default value as 1. For every time writing the value to the cell, Increment the value of Count by 1 i.e, in the assign activity → Count = Count + 1. Then, in the write cell activity, give the value as (assuming the column as A) : “A” + Count.ToString.

Then it will increase the row value in the same column.
Try and let me know.

Point 2- i found solution as createPageValid.ToString.Trim=“”

Didnt get you bro,Can share a screensnap

  1. Create a new variable “Count” as Int

  2. Assign the value 2.

  3. In the If else condition, Wherver you are using the write cell activity, use assign activity and give the values as

                   Count = Count + 1 
    
  4. While you are writing the cell value, i think you are giving the cell value as “A2”. Try replacing the 2 value dynamically with the count variable as mentioned

               "A"+Count.ToString.
    

Give it as “J”+Count.ToString

We are giving the row value with Count variable. so no need of 2 again. :slight_smile:

1 Like

But i want to pass the value from J2 ,since J1 has column name.

@karthikeyuan_subrama Initialize count value = 2

1 Like

You initialized with 1 and increasing the value to 2 before writing the cell. It will be ok. Try and if it is overriding the value of J1, then let me know

3 Likes

Thks buddy ,let me try

@HareeshMR its working ,Thanks a lot.

1 Like

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