(Environment: Filemaker12 / WIndows10)

I need to populate a new field - fieldA, for hundreds of existing records based on what is in existing field1, field2 and field3.

In simplest terms, if field1 is not empty then put a 1 in fieldA, same for field2 and field3.

Therefore fieldA could contain any combination of 1, 2 and 3, ie:

1

12

13

2

23

123

I know how to write a script to test the three fields for content and construct a variable

that can then be written to fieldA but I don't know how to make the script work to populate new fieldA for all the existing records.

I also wonder if there is a way to make fieldA a calculation field and write the proper steps in the calculation to automatically populate the field. Your suggestions and help would be greatly appreciated.

If you decide to make this new field a calculation field, then you use the Let Function:

Let ( [

f1 = If ( IsEmpty ( field1) ; "" ; 1 ) ;

f2 = If ( IsEmpty ( field2) ; "" ; 2 ) ;

f3 = If ( IsEmpty ( field3) ; "" ; 3 )

] ;

f1 & f2 & f3

)