From dictionary value, get files in folder count

Hi Guys,

In an Excel config file I have keys and values etc, string - object.
One such is a folder path.
Key = PdfFolderPath
Value = C:\Users\michael\Pdfs

Im trying to get the file count using the dictionary, not hard coding.
Below prints out the path and count of, perfect.
However im having to hard code the path in the Assign (PdfFileCount)

Screenshot 2022-12-31 123033

Ive tried below but getting an error, ive also tried.ToString after the .Count, no good.
Below assign is of int type.

Screenshot 2022-12-31 124058

Happy New Year to all :slightly_smiling_face:

Hi @MikeC ,

Could you give this a try?

Directory.GetFiles(Dict1("PdfFolderPath").ToString).Count()

If that doesn’t work, then would you be so kind as to include snapshot of the error message please?

Kind Regards,
Ashwin A.K

1 Like

YESSSSSSSSSSSSSSSSSSSS :ok_hand:

Thanks buddy, I had a feeling it was a bracket / quote issue.

Thanks again :slightly_smiling_face:

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