How to contain filename of 1st day of month and year from folder

Hi Team,

I want to add if condition based on filename from folder, that filename contain 1st day of month and year if not present in that folder then get from input template file from input folder ,than that filename need to create 1st day of month and year, if already current month file is present than pick the current month file.

Please anyone help me for this.

Input filepath:

Output path:

Regards,
Raja G

Hello @Raja.G
Use If condition

Directory.GetFiles("yourpath","*"+now.ToString("MMMM yyyy")+"*.xlsx").Count>0

Then use the file by the following the name

Directory.GetFiles("yourpath","*"+now.ToString("MMMM yyyy")+"*.xlsx")(0).tostring

In Else, create file flow

1 Like