Path Checks-If Decision


#1

Hi,

I have tried to create a Path Check sequence.However an error exists and due to this unable to test run the sequence.
image
Please advise .
Thanks


#2

Hi @azmee_zainol,

“Path exists” activity can be used.

Thanks,
Saranya K R


#3

Hi Saranya,
Thanks for the feedback.
I will try as per your advice.

Thanks again.


#4

Hi Saranya,

Sorry to ask again.As a newbie im not sure how to create a condition here.
Is it required some formula for this? or just simple phrase will do?
image


#5

No formula is required.
There is an existing activity to check whether the specified path exists or not.

Path exists
It will return boolean value i.e if exists TRUE or else false.


#6

Please find the workflow for better understanding.Path_Exists.xaml (6.7 KB)


#7

There have an error appeared as attached file.Is it because of the condition not meet the requirement?


#8

It is working fine for me.
I think “Exists” variable needs to be created of boolean type.


#9

Im sorry.
Could you give some examples ?


#10

Refer this link for creating variables.


#11

As per given link , i managed to solved the appear error.
However, the sequence result always show “folder not exist” even though the mentioned folder is exist at the specific path.Is there any missing activity should i add to the sequence?

image


#12

Hi @azmee_zainol

That is a creative way of solving the error, but a bit wrong.

The activity Path exists returns a Boolean value of either True or False. This Boolean value is then saved in a variable called Exist.

All you need to do is to set the Variable as Boolean over here:

And then change your Condition to only contain the variable Exist, just like it was previously:
image

What you did instead was to make a condition that will always return False :slight_smile:


#13

Hi,
Thanks for the feedback.
Much appreciate.

Thanks :slight_smile:


#14

Hi,
I have amended the steps as advice but the result still keep shows “Folder not Exists”.
The file and folder are exist.


#15

First, check if the variable Exist is set as Output of the Path exists activity, like this:
image

Also, is the folder you are trying to access literally called YYYYMMDD or does it have an actual date in the name (like 20180717)? This will only work if the name matches literally, for a date variable it is a bit more tricky.


#16

thanks it works…:grinning::+1:
now i have to create the sequence if No Exist keep searching/looping till found the file/folder and if YES continue to next process.

will try to create it 1st .
Thanks again :wink:


#17

Hi ,
How to identify the exact error as below screenshot?
imageUnprocessed file check 01.xaml (9.9 KB)
I have uploaded the sequence as well.

Please advise.
Thanks


#18

Hey @azmee_zainol

Check this:- Unprocessed file check 01.xaml (10.1 KB)

Regards…!!
Aksh


#19

Hi Aksh ,
Thank for the feedback.
I had go thru the attached file and found 2 points that are different from mine.
1-Folder Path
2-New DirectoryInfo(Folder_Path.ToString)

For no1 is it only Folder name or include file name?
And for no2, you have added .ToString after New DirectoryInfo(Folder_Path.

I have changed the same common with yours but error still persist.
Is it mean the error is from “For Each”?
But the expression editor “For Each” is same with yours.
I still cannot find the cause of this error.

image

Thanks in advance.


#20

you can change path to yours. :wink:

You have to tell me you wanna check Directories information or files information inside directory?

If second one then just change folder path in my sample workflow.

Regards…!!
Aksh