Write string value to datatable

I have an excel file of addresses I read into a DataTable and then pass each line to a website to process an address. It returns results that I add to a string variable. I can see this is working by viewing the results of the variable in a message box.

Now I’m trying to get all the results of the values assigned to the variable into a csv/text (tab-delimited) file, appending one line at a time. I’m a complete rookie so apologies in advance and please let me know what additional info is helpful

You can use the activity Append To CSV.

Apologies, I think my problem is that the data from my copy-paste, assigned to the variable “TextareaListOutput” isn’t being added to my DataTable. See image. Let me know if more info is needed. Thanks.

the add datarow like you have there will work to put all the text in that textarea field into the first cell of your datatable.

Thanks bcorrea! I definitely isolated the problem to the add row argument. It seems to not be imputing anything at all, though I can tell the variable I’m trying to pass in has values because when I add a message box to my loop it displays the text variable and when I do the same with datatable output to a message box I get nothing but blanks. Attached is the file if anyone has any leads. Thanks in advance for bearing with my lack of know-howSmartySheetsProcessing_v3.xaml (18.3 KB)

where did you get your outputdatatable from and did u initiate/build a new datatable?

and also, have you attempted level 1 through 3 for uipath academy? if no, please do, the basics are very much necessary to work with UiPath :slight_smile:

It looks ok, but do you really want to do the Output Data Table and the Message Box for every line of your CSV? because rn it is inside the For Each Row and it will make your DT1 to have only one row at the end…

No I don’t. I’m doing so just to see if there is any output. The file I’m pulling from just lists the addresses (see attached)SmartySheetsTester.xlsx (9.6 KB)

I’m ultimately trying to enter each address from my spreadsheet to the website, process the information and assign the results to a string variable (all working). Then, I want to put the result in that variable to a csv or txt file. This is where I am having trouble. I’m attempting to assign the variable to a data-table so that I can use it in the append CSV function.

The reason I’ve added the output data table is to see if I have any results in my data-table and it appears I don’t. I’ll keep trying and revisit the uipath academy. Thanks.

1 Like

I have gotten this all to work. I will work on communicating more articulately in my next post and will seek further training through the tutorials. I thank everyone on this post for taking the time to try to lend assistant. Thanks, everyone!

I don’t know why my message box was blank, but that was the problem. The data was in fact being stored in the DT1 table and was able to append to the csv

1 Like

can u share ur UiPath file. Thanks