Add value to attribute table with ModelBuilder

1788
1
06-11-2019 04:19 AM
BrigitDanthine
New Contributor

Hi everybody,

I need to add a specific value to an attribute table in the model builder. The whole basic workflow is as follow:

  1. from a point file extract all points with a specific value (=year)
  2. create heatmap of the extracted points
  3. create polygon based on the heatmap of the denser region(s)
  4. create a new field in the attribute table of the polygon layer from point 3
  5. write the specific value extracted at point 1 (=year) in the attribute table

Everything wents well so far, but I'm stuck at the point of add the specific value to the attribute table. I add a "calculator expression" to specify the points to extract in point 1 and was hoping to use the same expression to add it to the attribute table (point 5), but while point 1 is working as expected, point 5 isn't. I'm also not able to get it work by adding the expression directly inside the "calculate field" command.

Can anybody maybe help me to solve this problem?

Thank you very much in advance 🙂

0 Kudos
1 Reply
DuncanHornby
MVP Notable Contributor

I would recommend not attempting to join the expression to both the Make Feature Layer and Field Calculator tool. For the Make FeatureLayer tool the expression is correct as it as a valid SQL expression. For field calculator it is invalid as you only need to provide the value that you want to assign the the field art_id. If you think about it your field calculate is saying set art_id to equal "art_id" = '1990_114_4'  which is gibberish. You simply want to set art_id to the text "1990_114_4" not a SQL expression.