Problem Statement: We need to find the average file size in a folder selected by user at run time
Here is how you can do it.
Drag the assign activity to the project workflow and write the following code
This method is used to get the files from the folder selected by the user and extracts the files present in the parent folder. However, you can apply other arguments to this method to get the file based on extension and within sub-folders
This query uses the FileInfo class to get the length of the file and then does the average
Here is the complete solution to this video
You can download the code here : UiPathSamples/12 - Calculate Average size of file in a folder at main · manojbatra071/UiPathSamples · GitHub