Select to view content in your preferred language

Is it possible in Model Builder to use a String Variable and Get Field Value Variable to reference an input file for a tool?

6684
11
05-31-2016 04:28 AM
RichardG
New Contributor II

ModelImage.png

I have a model which is set up to first iterate (using Feature Selection) through all points in a feature class using a unique value from field X (string).

The model then takes this feature and runs it through the Get Field Value tool in order to identify the attribute for any given feature from field Y (string).

This point is then fed into the Batch Watershed Delineation tool from the ArcHydro Toolset. Each of the input files for this tool are located in the same raster folder. Input files all begin with the same text. E.g. for Input Flow Direction Grid I have several files in my folder that start with "fdr" and end with the attributes gathered from the Get Field Value.

I created a string variable which points to the folder containing the raster files. I named this variablerasterLocation. I have tried to reference each of the relevant input files in the Batch Watershed Delineation Tool, e.g. %rasterLocation%fdr%Y%

However, I get the error message - "Input dataset does not exist or is not supported."

0 Kudos
11 Replies
curtvprice
MVP Esteemed Contributor

You got it. Data set names, even temporary ones, should never begin with a number.

How To Name Things In ArcGIS

0 Kudos
RichardG
New Contributor II

This is actually not the solution. The error messages beside the input file names only went momentarily. Once I clicked 'Validate entire model' the same error messages appeared.

The issue seems to be solely to do with the 'Get Field Value' reference.

The process works fine if I use the following path name for any given file %rasterLocation%fdrha03.

However, if I try to use the Get Field string variable (e.g. ha03, ha04, ha05 etc) then I get an error message. The path is set as follows %rasterLocation%fdr%HA%

0 Kudos