Select to view content in your preferred language

Model Builder not Appending Data Correctly ?!

7357
18
02-10-2015 12:55 AM
timdunlevie
Regular Contributor

Hi guys,

 

I'm using ArcGIS 10.2...and I'm getting some frustrating results using Model Builder to append data to a Feature Class within a FGDB.

 

I have 6 datasets (a mix of shapefiles and FC in a FGDB)

The steps I perform in the model include:

1. add fields to these datasets

2. calculate fields

3. append to a "master" FC in a FGDB using schema type "NO_TEST" and field map the various fields from the input datasets to the Target.

 

for some reason the data is not appending correctly. The field mapping looks correct.

I've deleted features from the Target FC (empty FC) and tried appending over again, yet the same (wrong) fields map to the target fc.

is it holding this data in memory ???

Is MB always so buggy ?

 

many thanks,

Tim

Tags (1)
0 Kudos
18 Replies
PaulLohr
Frequent Contributor

If you are still working on this, you might want to look for a different approach. Maybe try Copy Features then append that result into your master feature class. Maybe try Make Feature Layer then append. Things simply don't work right in modelbuilder and this is how I have been able to make things work.

timdunlevie
Regular Contributor

Hi Paul,

Thanks for the suggestion….I will give it a go.

Seems strange that Model Builder is very buggy.

Tim

0 Kudos
timdunlevie
Regular Contributor

Thanks mate.

In the end I converted to a python script instead….MB was doing my head in.

Tim

DarrenWiens2
MVP Honored Contributor

Does it work as expected outside of ModelBuilder?

0 Kudos
timdunlevie
Regular Contributor

Yep – tested this.

All I am doing is adding 6 shapefiles/FCs to MB.

Adding a few fields to each.

Updating the metadata…

Then appending to a blank FC….field map to the relevant fields.

I was just curious to see if anyone else have had a similar experience.

Thanks

0 Kudos
DarrenWiens2
MVP Honored Contributor

It looks like plenty of other users are experiencing the same thing with field mappings in ModelBuilder. Working alternative seems to be to implement in Python, which may or may not be a significant time commitment for you.

0 Kudos
curtvprice
MVP Esteemed Contributor

Field mappings are a little problematic in ModelBuilder because they are set up so they can be user-edited within the MB edit mode. If you change the inputs, those field maps don't always update unless the model is re-validated, and event then if you've done edits to the field map it tries to keep it around.

I have worked around this by using code to create field maps at runtime inside the Calculate Value tool. Not an easy or elegant solution.

JoeBryant2
Frequent Contributor

Curtis, I am having this same Field Mapping issue. Python is not an option for me currently because of the time commitment as Darren suggested.

Do you have a custom Calculate Value script that I could insert in my model to get the field mapping to update each time it runs?

0 Kudos
curtvprice
MVP Esteemed Contributor

Can you describe exactly what this field map is supposed to do?

The "poor man's" way of doing this is to create a template dataset with the fields you want, and then for the inputs add and calculate fields with the appropriate names. If you do this, and provide an empty field map as a parameter so one will be created at runtime, the Append tool with NO_TEST will just ignore the fields that do not match.

0 Kudos