For additional info,i created this variable FileList as an system.object as variableType,and called this variable below and got this error.
I am just a beginner and its my 6th day learning this RPA tool so can anyone please help?
And moreover i have to use for-Each loop only stead of for each row,here my main motive was to scrap the data from some pdf file and make a datatable at the end
But i have to read some pdf files,so will string array be applicable because i think to read pdf files/word document we need to take variabletype as Array of object.
Very cool that you are learning to get help here on the forum! Well, for each is an activity that runs through variables that are iterable! In this case, you created your FileList variable as Object and this variable is not Enumerable to be iterable. By default, the Directory.GetFiles method returns an Array of strings, where each element of this array is a String containing the file path. An array is an iterable variable in for each!
See that we can even work around the case. But it’s not a fancy way.
So you can change you variable to Array of String!
Shivam, the Read Pdf activity takes as input argument the path of the pdf file! The pdf file path is a string, so you can treat the pdf document as your own
own full path. The activity itself is in charge of opening this file with the desired extension and verifies if, in fact, it represents a .pdf file.
Thank you all for helping me,
So i did some changes(was just doing experiment to the statement in the 1st assign activity ) and as soon as i removed (.toString) from Directory.Getfiles(“path”),it worked because what i was doing was,trying to assign this string to a 1-dimensional array of objects which is not possible with string
Thought to update you all coz you all were helping me.