Write value in empty row in between data inside loop

Hello experts,

I have a loop process to scrape data from a web and paste it into Excel and it looks like this.


Each data in red box got extracted from the loop process.
However, I need to write value inside the highlighted cell in green - which is in between of the extracted data. The number of rows in each extracted data is dynamic so I can’t set a specific cell to write the value.
The value is Day 1, Day 2 and so on respectively until the last day of the month.

I have tried Write Cell and Write Range activity but it keeps got overwritten by the extracted data.

Need your guidance please…

Check the following code:

For Each row in **[name of your dataTable]**

If String.IsNullOrEmpty(row) = True Then
 i = 1 
 row(0).ToString = "Day" & i.ToString
End If


Hi Fer,

Thanks for your guidance. However I’m getting error.
Did I declare it correctly in the arguments?


Hi @nawkaz,

Hope this could help you.

I think that the @Fer proposal is only a pseudocode, not the final solution.

You can use invoke code or you can use uipath activities to get the same goal.

If you choose to use UiPath activities then your code should be something similar to the following pic:

If you choose to use Invoke Activity then you have to read carefully the error message. For example , the issue “Expression is of type “System.Data.DataTable”, which is not a collection type. At line 1” can be solved using “For each row in ExtractDataTable.Rows

Best regards,

Thank you!!

@Susana, how can I make the invoke code activity appear on activities panel?

Thanks in advance.

Hi @Fer,

You can find the UiPath.Core.Activities.InvokeCode under the workflow-invoke group.

The search box of the Activities panel can be used for finding activities by their class name, regardless of the interface language set in Studio.


Best Regards,

I do not have that Invoke Code activity.


Hi @Fer

What version is your Studio and activity packages?

I am using the version 2016.2.6442. But the invoke code activity is only available for versions starting with v2017.1.

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