How to Fix this please? Thank you

image

Hi @Haider_Capistrano

With your image reference…
The CurrentWeek is not a type of Datatable.
It is a string variable

Datatable variables only consider in that part.

Kindly check the datatype…

Thanks
Harivishnu

Hello Sir

I tried to change the type to string or int32 but still got same error

As the error message clearly says, you are using a string variable where a datatable variable needs to be. Write Range doesn’t write one value, it writes a datatable to the sheet - multiple rows and columns.

What are you trying to do?

Trying to get a text and import it to excel.

Can you give more detail? Get text from where? A single value? List of values? Table of values? Show us what you’re doing, post screenshots of your code.

The simple issue here is you are giving Write Range a single value (string) where it requires a datatable (rows and columns).

Have you done the free training on the UiPath Academy web site? It covers these kind of things.

Getting a single value from a web.

What are you building a datatable for? Can you please show us what the data looks like, what you want to write to Excel, etc? You have to give us details or we can’t help you.

unnamed

This is the data that I want to put on my excel.

Hi @Haider_Capistrano ,

After you get the text from the website, you would need to add the text to the Datatable using Add Data Row Activity.

Then maybe we could use Write Range Activity and write the Datatable to the Excel.

But could you also show us what is done in Build Datatable Activity and what are the columns prepared/created in it?

Hi @Haider_Capistrano

  1. You can use all the activity that required

  2. Use Build DataTable activity _> Store it as DtBuild

  3. Use GetText activity, Extract the data from the website → Store its as CurrentWeek

  4. Use Add Data Row activity

image

  1. Use Write Range activity → Pass the DataTable as DtBuild

Check out te Skeleton the workflow

AddDataRowSkeleton.xaml (8.9 KB)

Regards
Gokul

Hi @Haider_Capistrano

Use For each data row for your Test Scenario Dt.
Inside the Sequence Do all your Process.
After getting your OutputValue will be String if you use this

ex:
Currentrow("ColumnName").tostring="Your Value"

Thanks,
Harivishnu :wink: