How to not let my data get overwritten?

Currently I am trying to loop a process, and using cell lookup to write the data into excel. However, it is also overwriting my existing data.

Current Data (4.9 is existing data)

If I run my workflow 4.9 is replaced with 14.0

Would it possible to make it so that it fills up in one of the empty cells like the example below?

@HENG_JUN_YING_AARON

Take an If condition and mention as below

String.Isnullorempty(CurrentRow("YourColumn Name").Tostring)

within that if condition use the write cell activity

Hope it helps!!

Thanks for your reply, however I am returned with this error

@HENG_JUN_YING_AARON

Can you share the syntax in if condition?

Regards

Would this be what you mean?

image

I have also attached my entire workflow if you need it for any reference
DelGro.xaml (18.4 KB)

@HENG_JUN_YING_AARON

Use the below syntax

String.IsNullOrEmpty(excelrange.ToString)

Regards

Nothing was written after changing the syntax

@HENG_JUN_YING_AARON

What is the output of excel range variable.

regards

It is supposed to give me the cell position of the month the lookup finds, in this case since my invoice was in April 2022, the output would be the cell position of April 2022 in the excel.

Here is a Message box result of the excelrange variable
image

@HENG_JUN_YING_AARON

Bro is it an important or dummy data

Regards

@HENG_JUN_YING_AARON

Please find the below attached zip file

Test Process.zip (143.5 KB)

Hope it works!!

@HENG_JUN_YING_AARON

  1. Once you get N1 as output(as example) …always you would get 1 so use replace to replace 1 and then read the data of only one column
  2. Use read range with range as excelRange.Replace("1","") + ":" + excelRange.Replace("1","") and stored in dummyDT
  3. Now use the following to find the last empty row numberdummyDT.AsEnumerable.Where(function(x) Not String.IsNullOrEmpty(x(0).ToString)).Count+1
  4. use ExcelRange.Replace("1","") + valueFromstep3 in write cell

cheers

Use Find First/Last Data Row to find the last row that has data.

Use that information to create the cell value to pass to Write Cell.

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