With FTP/Enumerate files output issue

Hello, Had to update FTP activities package as the old version was not connecting to the server anymore. We used With FTP Session and ad an in FtpSessionGen argument for login.
The flow was as follows:

  • login to FTP
  • enumerate files to Datatable variable
  • for each row apply If condition and do action

Now we are using With FTP Session, and credentials are retrieved through assets. The login is being performed, but seems that Enumerate files activity we used in the past now has an output as Ienumerable.
Is there a way to convert that to datatable and keep using For each Row?
I tried to use For each, but had additional issues.
Beginner here so any help is welcomed.

Hey @Emilian_Ivan

Yes that is possible to convert the iEnumerable to DataTable if you can show in debug mode what that iEnum really contains.

But the other option is why we need to actually convert the iEnum to DataTable instead to iterate the same with ForEach directly as it is still logically same as what we do with DataTable

Hope this helps.

Thanks
#nK

Hello @Emilian_Ivan

Here as per my understanding you dont need to convert the iEnumerable to Datatable. What you can do is loop through iEnumerable using For Each activity instead of For each row activity.

Based on the IEnumerbale type you need to set the row argument.

Thanks

Thank you for the replies. We use REFramework, retrieve credentials and the pass is in SecureString. This means we need to use SFTP option and secure password.
When using for each, i need to check for date condition in the file names. so i use the below condition, where in_date_String is an argument passed in.
item(“Name”).ToString.Contains(in_date_String)
The error i get is Compiler error(s) encountered processing expression “item(“Name”).ToString.Contains(in_date_String)”. Option Strict On disallows late binding.
Have tried bypassing that but to no luck…

Issue now fixed.

For each was the way to go. The thing was that in the type Argument we had to select UiPath.FTP.FtpObjectInfo and not the variable type (the Ienumerable item).

We had tried and failed with Object and Systems.Collections.Generic.IEnumerable<UiPath.FTP.FtpObjectInfo>.

Cool great buddy :+1::slightly_smiling_face:

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