Skipping model branches that do not have data

1953
2
02-18-2016 08:32 AM
MantasButrimavičius1
Occasional Contributor II

Hello guys,

I would like to ask if you know how could I prevent my model from attempting to run model branches that do not have data.

For the record, the purpose of this model is to clip specific data from given database and convert it to shapefiles.

model_picture.PNG

As you can see above, I have 4 independent branches that uses 3 same parameters: Database (from which data comes), Area (as a clip input) and Folder (where shapefiles are generated in).

Unfortunately, the problem is that required data is stored in several databases and it migrates from one database to another. So, I have to run this model for several databases to collect all shapefiles that I need. However, I obviously cannot do this because if even one branch does not get any data (in the "Make feature layer" step) whole model does not work and I get the error that some data is missing.

I would like to insert some tool that checks if required data exists in database or not. If it does not exist, that branch gives nothing and continues to another branch. In this scenario I could collect some shapefiles from one database, then change the database, re-run the model and collect rest of the shapefiles.

Could you please suggest some tools to do what I need. I have already tried to use if/else by Calculate Value tool but I am new to Python, so a little help would not mind at all.

Thank you in advance.

0 Kudos
2 Replies
DanPatterson_Retired
MVP Emeritus

Exists—Help | ArcGIS for Desktop

is the only thing i can suggests... but it would entail a script in the model

MantasButrimavičius1
Occasional Contributor II

Thank you for the advice.

As I understand, ArcPy function Exists can be inserted by Calculate Value tool inside model. I did it by using this If you are stuck at "if" – Part 1 | ArcGIS Blog (Example 3) as an example. However, I still need to learn a lot about ArcPy.