Select to view content in your preferred language

Inline variable substitution in ModelBuilder with submodel

1164
2
Jump to solution
02-06-2019 09:19 AM
RebeccaFuda
Occasional Contributor

I have a model that uses two iterators, and so I am using submodels.  However, I am having trouble getting my main model to recognize inline variable substitution for a variable from the submodel.  When running the intersect tool after running the submodel, I get the following error: 

Executing (Intersect): Intersect "E:\BFuda\GIS_Data\Properties_For_Sale\overlap_layers\sg_cor.shp #;E:\BFuda\GIS_Data\Properties_For_Sale\parcels_final\analind.shp #" E:\BFuda\GIS_Data\Default.gdb\%Name_wl% ONLY_FID # INPUT
Start Time: Wed Feb 06 10:12:37 2019
ERROR 000210: Cannot create output E:\BFuda\GIS_Data\Default.gdb\%Name_wl%
The table was not found. [%Name_wl%]
Failed to execute (Intersect).
Failed at Wed Feb 06 10:12:38 2019 (Elapsed Time: 1.35 seconds)

The model and submodel are shown below: 

The inputs for the Intersect tool are shown as follows:

0 Kudos
1 Solution

Accepted Solutions
RebeccaFuda
Occasional Contributor

I solved this problem by designating the Name_wl variable as a parameter within the submodel.  Then within the main model, I right-clicked on the submodel and chose Make Variable | From Parameter | Names_wl.

View solution in original post

0 Kudos
2 Replies
RebeccaFuda
Occasional Contributor

I solved this problem by designating the Name_wl variable as a parameter within the submodel.  Then within the main model, I right-clicked on the submodel and chose Make Variable | From Parameter | Names_wl.

0 Kudos
AbiDhakal
Frequent Contributor

I'm using a ModelBuilder to select Multiple values from a layer and it is not working. It only works when I select a single value. What am I doing wrong please.

Model:

AbiDhakal_0-1722620625263.png

Select Layer By Attribute expression window:

AbiDhakal_1-1722620625370.png

Parameter:

AbiDhakal_2-1722620625264.png

Geoprocessing:
In the window below marked in red, if I only put one value (SPB) then it will select, however if I put multiple values (SPB, EAB, etc.) as shown below it will not select. 

AbiDhakal_3-1722620625508.png

I've added a variable to the model that would allow me to put Multiple values.

AbiDhakal_4-1722620625464.png

 

Please help me.

Thank you,
Abi

0 Kudos