Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

This question likely has a simple answer or the behaviour is by-design and is not worth fixing.

The simple model below uses an Expression to 'Select Layer By Attribute." When this model is run, the expression will remain the same but the ID attribute value can changed based on user input.

Therefore I have exposed a string variable as a model parameter, and am using inline variable substitution to add the user's value in the query expression (the datatype of the [LeaseID] field happens to be a string and not integer/numeric).

I would like to have the "Lease ID" model parameter connected to the "Select Layer By Attribute" tool. This is purely aesthetic and is not required for the model to run successfully. I believe it would look better, be more intuitive, and be easier for new users of Modelbuilder to understand where the model parameter is being inserted into the tool.

I could just expose the Expression parameter of the tool as a model parameter...but then anyone running the tool would modify the whole expression and could cause unnecessary error(s).

Any thoughts on how to do this...I would prefer that the variable not be floating in free space. Thanks.

Modelbuilder image

Full size image

share|improve this question

1 Answer 1

up vote 3 down vote accepted

Simplest answer is to make your input a pre-condition for the tool. You can select the tool's properties and mark that input as a pre-condition or connect them with the "Connect" tool and select precondition from the context menu. By default that will make it a dashed line connecting them, but I believe you can change some of the display settings if really needed. Plus, doing this will help ensure it runs correctly as it will evaluate that Lease ID is available BEFORE attempting to use that within the tool your using it in. In my experience, it's always good practice in Model Builder to use pre-conditions where connections are explicitly diagrammed, just to be sure they actually run in the correct order.

share|improve this answer
    
Good call @John. I am aware of preconditions...but didn't even think about it for this question! I was thinking of physically connecting it because the variable IS being inserted into the tool...but your suggestion makes perfect sense. Thanks. –  amarinel Apr 11 at 18:08

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.