Field name of Extract multi values to points changes for repeated run in Model Builder

2085
11
09-14-2017 11:16 AM
ChamnabEM
New Contributor II

Hi,

I am using Model Builder using: extract multi values to points from a raster, and then use the extracted value as input feature of building another raster.

My problem is that after create the Model, when I run first time, it worked well but from second time it didn't work because every time I run it, the new field was created with number at the end, and the raster building read only the first field that was set.

Ex: In the Model, in field name "vegetation" was set to extract multi value to points and raster building. For running from second time, the filed name created from extract value to points turned to "vegetati_1", "vegetati_2"... while the setting in raster builder was still to read field "vegetation". So that the raster created found no changes even if the input data was changed.

Could anyone share your idea on this?

0 Kudos
11 Replies
DanPatterson_Retired
MVP Emeritus

the help topic suggests making a copy of the input first since the tool modifies inputs... do that and work on the copy then your field name will not change

ChamnabEM
New Contributor II

Thanks Dan.

Maybe my expression was not good. When using Extract values to points, it will create a new field in the input. And that new field will be create more and more as much as we run the extraction such as: "vegetation", "vegetati_1", "vegetati_2".... I need to use it in the model builder where field "vegetation" is used in next calculation, and I don't want to go to change the field setting everytime I run.

0 Kudos
DanPatterson_Retired
MVP Emeritus

I don't have any suggestions, perhaps this is where python would be better

0 Kudos
ChamnabEM
New Contributor II

I am so new to python. I will manage some times on Python. Thanks Dan.

0 Kudos
ChrisDonohue__GISP
MVP Alum

Just a quick thought on a workaround - add a process after the first Extract to Points output to rename the offending field to what is needed for the input before doing the next iteration.  For example, Alter Field (Data Managment) could be used to rename the field.

Alter Field—Data Management toolbox | ArcGIS Desktop 

Outside of that, it would probably be helpful to see what the model looks like to get a sense of how things are currently structured.  There possibly may also be some options to use In-Line Variable Substitution or other methods to resolve this, but it depends on how it all is currently set up.

Examples of inline model variable substitution—Help | ArcGIS for Desktop 

Ultimately, if you will be doing this process often and are comfortable with Python, I'd go with the suggestion by Dan_Patterson and use Python instead.  Modelbuilder can be useful but it is quirky in some ways.

Chris Donohue, GISP

ChamnabEM
New Contributor II

Model Example

Hi Chris.

Thank for your suggestions. Attached image is a part of Model that I want to build. In this model, I need to select Field to use of each input. But I don't want to select it all the time and I want something do it for me in the model.

First run, it created field vegetation, second run it created field vegetation_1, and so on. The image is the 3rd run diagram. But I want to use the latest one every time I run the total model without go to change it all the time, so that the end-result of the total model will be correct by using correct data.

About Python, I am new to it but I will manage some times later to learn.

I hope I can get more workaround on this.

0 Kudos
ChamnabEM
New Contributor II

As this was not solved, I remake the confirmation.

I just want the extracted value from raster to only one field every time I run the model, as it was automatically create new field when repeated running.

Is there any workaround for this?

0 Kudos
DanPatterson_Retired
MVP Emeritus

As I suggested earlier, each time you run your model you should work with a copy of the input file, in that way the next time you run it, the input file has not been altered and the added fields won't exist in the original.

0 Kudos
ChamnabEM
New Contributor II

Hello Dan,

ExtractMultiValue_Copy

Is this scheme as what you mentioned?

0 Kudos