Formula to write line and stop at blanks

hi, this write lines for all range i indicated as it is hardcoded but i wish for it to only write if the IF condition is fulfilled, what formula can i use?

Hi @Pyx

Can you please describe the scenario?

Cheers.

hi, so i wish to replace job status with “robot 2 completed” instead of “robot1 completed” if status is “robot 1 completed”

Hi @Pyx

can you check this workaround?

Not String.IsNullOrEmpty(CurrentRow("Customer Name").ToString()) AndAlso Not String.IsNullOrWhiteSpace(CurrentRow("Customer Name").ToString()) AndAlso CurrentRow("Job Status").ToString().Trim().Equals("Robot 1 Completed")

Use a write range at the end to write again your datatable

Regards

hi im asking for the formula for the write range cos now it is hard coded so how do i make it such tht it stops writing at blanks

Not String.IsNullOrEmpty(CurrentRow("Customer Name").ToString()) AndAlso Not String.IsNullOrWhiteSpace(CurrentRow("Customer Name").ToString()) AndAlso CurrentRow("Job Status").ToString().Trim().Equals("Robot 1 Completed") AndAlso Not String.IsNullOrEmpty(CurrentRow("Job Status").ToString()) AndAlso Not String.IsNullOrWhiteSpace(CurrentRow("Job Status").ToString())

Add the above code in your if activity, in the Then field use your write range, it will write if all the contitions meet (Job status is not blank or empty) and (Job status Equals to Robot 1 Completed) and (Customer Name is not blank or empty). With this it will stop writing if any empty cell is found

Regards

hi, it didnt work:( it wrote for the range i indicated in my write cell range, is there another formula to indicate in range?

@Pyx

You should first use a loop to do that

  1. Use for each excel row activity and check the value of currentrow.Field(“JobStatus”).ToString.Equals(“Robot1 completed”)
  2. On then side use assign with currenrow.Field(“JobStatus”) = “Robot2 job status completed”

Hope this helps

Cheers