How to insert values into a template

Hi,

I have a template, I want to insert some dynamic values into the defined template. The template is in excel format. I just want to open the excel template and replace the existing values. The template attached for the reference. How to make this possible.
image

Replace CPU percentage only, This is in cell B or C whatever

1 Like

One solution would be to read excel into the datatable and update column values in datatable and then write back entire datatable to excel

Hi @prejith
Scenario
1.Use Excel Application Scope Activites.
2.Use Read Range Activities.
3.Create a variable with datatype Datatable.
4.Use it to ReadRange Activities output properties.
5.Use Foreachrow activities to iterate in the loop.
6.Use Write Cell to write your desired value.

cheers :smiley:

Happy learning :smiley:

You can use write cell activity to update your template.

Hi ,
Please use excel application scope and give the file path
Now use Write cell activity
And give the cell number you want to write the values

@prejith

Try these steps.

  1. First use Read Range activity to read the data from excel file and will give you output as DataTable and say ‘DT’.

  2. Then use ForEach Row activity to iterate DataTable.

        ForEach row in DT
           row("CPU PERCENTAGE") = "newValue"
    

And then finally use Write Range activity to write into Excel file. In this way, we can easily update values irrespective of column position.

Note: If you want to replace value in particular cell then we have to use Write Cell activity and you have to specify the range of the cell also.

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