Select to view content in your preferred language

Using a Value Table to Calculate Multiple Fields

3428
1
07-01-2015 11:03 AM
DanielInterrante
Deactivated User

Hello,

I'm looking to develop a tool (ideally through model builder as my python writing ability is not stellar) that creates a simple user interface that has dropdown menus for desired fields of a selected table and typed input users to type in a numeric value for each.  I.e.:

FIELD    VALUE

A         =  30

B         =  50

C         =  10

ect.

I'm stuck in two places here:

1. I'm creating a value table in model builder with a column type of "field" and a column type of "string."  I'm having trouble linking this value table of inputs to the input table.  I can't make it a precondition, or a dependency parameter in the properties menu.

2.  I'm then trying to run an "Iterate Multivalue" through my value table and then for each iteration call both the field and the value into the "Calculate Field" tool.   Would simply calling %Field% for the field input and %value% for the expression input suffice, I'm not sure what is being contained in the "Value" output of the iteration. 

Thank you!

0 Kudos
1 Reply
DuncanHornby
MVP Notable Contributor

I'm a bit confused in what you are asking for? You say you want a solution in model builder but talk about ValueTables. To my knowledge these don't exist in model builder. They are controls that can be exposed in a Python Toolbox, an environment you specifically say you want to avoid. You are mixing concepts from Python Toolbox, scripting and model builder.

I wrote a short guide about ValueTables here, may be that will help?

0 Kudos