Auto-populate field

318
4
Jump to solution
05-29-2019 03:20 AM
TomPiggott
New Contributor II

Hi,

I am doing a project were I am taking all the survey data for archaeology found in an area and trying to make it into a simple user format to show people.

(Ive pulled all the survey from a CAD drawing so excuse some of the field names). I want to take the data in the layer column and refine it. the layer column is based on the data given to the archaeology (i.e bronze age, medieval) but there are over 30 variations in the name. 

so as an example. I wanted to take all the variations of the spelling of medieval(_med, _m, med, MED) in the layer column and refine them just to medieval in the 'date_refined' column. I have over 30,000 entries and didn't want to do it by hand. 

I have some very basic python knowledge - could this be achieved by an else if statement? if so what would it look like? 

Thanks

Tom 

0 Kudos
1 Solution

Accepted Solutions
Egge-JanPollé1
MVP Regular Contributor

Hi Tom Piggott‌,

Workflow (manual process):

  • Select records WHERE "Layer" IN ('_med',' _m',' med','MED')
  • Use Field Calculator to update field "Date_Refined" with value 'medieval' (only selected records will be affected)
  • Change selection and update (using Field Calculator) with other value
  • Repeat until all records have a value for "Date_Refined"

Does this work for you?

Egge-Jan

View solution in original post

0 Kudos
4 Replies
Egge-JanPollé1
MVP Regular Contributor

Hi Tom Piggott‌,

Workflow (manual process):

  • Select records WHERE "Layer" IN ('_med',' _m',' med','MED')
  • Use Field Calculator to update field "Date_Refined" with value 'medieval' (only selected records will be affected)
  • Change selection and update (using Field Calculator) with other value
  • Repeat until all records have a value for "Date_Refined"

Does this work for you?

Egge-Jan

0 Kudos
TomPiggott
New Contributor II

Hi thanks for sending this through, it works by selecting the required fields.

what should i bet putting in the field calculator. 

[Date_Refined] = "Medieval"  ???

0 Kudos
Egge-JanPollé1
MVP Regular Contributor

Hi Tom,

Yes, [Date_Refined] = "Medieval". Did you try that already? If it doesn't work, it should be 'Medieval'. (I always forget whether it should be single or double quotes.)

The Field Calculator only affects the selected records (unless there is no selection; in that case all records will be updated).

Please let me know how you are proceeding. If you think your issue is solved, don't forget to mark the question as being answered.

Cheers,

Egge-Jan

0 Kudos
TomPiggott
New Contributor II

Thanks Egge-Jan I got it to work after changing the quotes

Thanks

Tom