Select to view content in your preferred language

get field valule and calculate field in modelbuilder

911
2
08-06-2021 07:00 AM
soniaS
by
New Contributor

Hello,

I'm using ArcGIS Pro V 2.8.1

I'm trying to make a modelbuilder with thoses steps :

1) get a geodatabase in a folder

2) get a specific table in this geodatabase

3) get a field value from an other table (with a test condition)

5) calculate a new field with calculate field (it's a text field), and fill it with the get value function

soniaS_0-1628257536283.png

 

  So, my problem is that the calculate field function doesn't fill the table with the selected value.

when I select the data type " string" in the get field value, I have this error;

soniaS_2-1628258002838.png

 

soniaS_1-1628257851342.png

but when I select the data type " field",  in the get value, I dont have errors but the new field in my table is empty.

soniaS_3-1628258086932.pngsoniaS_4-1628258120257.png

Thanks for your help!

0 Kudos
2 Replies
SarahHartholt
Frequent Contributor

The Get Field GP tool only returns the first row according to the ESRI documentation (Get Field Value (ModelBuilder)—ArcGIS Pro | Documentation). If you are trying to copy a field value from one table to another I believe you need a common ID field to join the tables together before you perform the field calculation.

0 Kudos
soniaS
by
New Contributor

Hello, thank you for your answer,

Indeed, I was trying to retreive a value from an other table in order to add this value in a field, ( the same value for all features, as the calculate field does).  In fact, my goal is to realise a join with those tables and on this common ID field after this step. So thanks to your answer, gess that it is not the good method.

Maybe do you know a good way to add a value from an other table in a new field ?

Thanks a lot!

0 Kudos