How to assign an array for every For Each Wait for Download file

I have an array of string with multiple htmls of reports that a For Each activity runs through each one and downloads the CSV to a folder via Wait for Download. It worked perfectly.

Now my requirement is to load those downloaded CSVs into an array of string variable. What would be the Value to save in the Assign activity in this instance?

Thank you (I am SFDC admin turned UiPath beginner)

@Lilly_Beauchamp
welcome to the forum

we would doubt, if loading the CSV string will later support on the next processing steps. We could expect that later the CSV data e.g. as a datatable is needed. Maybe you can elaborate more on your business case.

However we would suggest the following, when above is adressed.

Create a variable - myCSVContent | DataType: List(of String) | init / default value: new List(Of String)

then within the For Each

  • your steps
  • Wait for download
  • Read Text File Activity - str_File.FullFilename - out: strCSV
  • Assign Activity: myList = myList.Append(strCSV).toList

also have a look here for prototypings and tracings

1 Like

Hello @ppr, thank you for your reply

My business case:

  • download a list of Netsuite reports into CSVs
  • upload the CSVs into corresponding Snowflake data table

I created a sequence that successfully operated with 1 Netsuite report/1 Snowflake data table. Now I am trying to create the version that runs through the list.

I created two string of array variables: 1 for the Netsuite report links and 1 for the Snowflake data table links. The For Each activity runs through each of the Netsuite reports and downloads the CSVs.

Now I am trying to get Snowflake to access those CSVs to upload in a separate For Each activity.

I believe you are correct in that a dataTable variable is what I am needing instead.
And after reviewing the link you shared I would be wanting to append the CSV file in every For Each loop, as I want it to add the files in order so the Snowflake sequence uploads in order of the corresponding data table links.

I have added the DataTable variable, Read Text File activity, and Assign activity but receiving errors on all three.

Would appreciate your input/advice so far

maybe you can share the XAML / complete screenshot / exported Diagram with us as from the above description we cannot derive all needed information

1 Like

@ppr Here you are, thank you



At least work on the next parts:
grafik
ensure that the variable / value is correct assigned

grafik
when using a variable we do not surround it with " as this will change it to a String instead the needed statement

not sure, what is tried here:
grafik

when CSV Data as text is needed then we would expect more a loop / or the looped CSV Data

Thanks @ppr, I have started my sequence over beginning with a Data Table. Still in progress

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