Fantastic
so this will return only one file - a string
rather
lets do one thing
–use a assign activity and mention like FilePath = Directory.GetFiles(“yourfolderpath”,“*.xlsx”)
where FilePath is a variable of type string array
–now use a if condition like this FilePath.Count > 0
if the above condition passes it will go to THEN part where we can get the first file path
like we did previously using assing activity FilePath_1 = Directory.GetFiles(Path,“*.xlsx”).OrderByDescending(Function(d) New FileInfo(d).CreationTime)(0).ToString
where FilePath_1 is a string variable
–next to this use a path exists activity and check whether the path exists or not
and remaining steps same (all inside the THEN part)
Hi @Palaniyappan I am sure it will work fine. But I need the value in True/False as I have to invoked this workflow in the main and then use the condition further on the base of the true/false result.
Okay understood will implement it bro. Let’s how it’s work
Yes of course we can assign this to a Boolean variable using assign activity
Out_boolean = FilePath.Count > 0
Where Out_boolean is a variable of type Boolean
Which can be taken as OUT argument from this xaml and assign it to a global variable in the main
And that global variable can be assigned as a value to a IN Argument of another invoked workflow xaml
Hi @Palaniyappan It’s working fine when there is a file in the directory, when there is no file in the directory then it throw this error as it thrown previously.
Hmm
I don’t understand actually it should go to else part when the FilePath.Count < 0 fails
Which actually means there is no file in it
Strange buddy
Cheers @balkishan
Actually we can enter only a condition and not a assignment of value to a variable
So that’s why
Kindly remove the Isfileexist =
And keep the filepath.Count>0
Fine let’s do one thing
Let’s keep this whole setup inside a try catch
If any exception occurs like if there is no file then it will get to catch block where we can assign a Boolean variable like Bool_NoFile = True
Where Bool_NoFile is a Boolean variable with default. Value False
Then this variable can be give to an OUT argument as mentioned here