cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

File exists or not

munish
New Contributor

I am designing a pipeline where I need to put a condition.
If (File exists)
then run snap 1
else
run snap 2

I want to achieve this with snaplogic pipeline. please help

3 REPLIES 3

dimche_saveski
New Contributor III

Hello @munich

1 way of achieving that scenario is by using Snaplogic List snap and downstream Router snap.
Snaplogic List snap will be configured to list just file assets, and then check if your desired file exists( in the Router snap).

Best Regards
Dimche Saveski

christwr
Contributor III

If the problem is doing something else when no data to trigger your downstream snaps (router, etc.) you could look at patterns in some of the โ€œwhen no dataโ€ threads like below:

Basically create some fake data, join it with your actual data (or missing data) from your directory browser, then check if you actually had data or not in the downstream router snap (if/else).

Supratim
Contributor III

@munish - Use directory browser snap and dis-select "ignore empty result " , then use mapper and check hasOwnProperty() to check โ€œNameโ€ is available or not. If not then snap2 else snap1