Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Importing multiple fields into an array

Featured Replies

I posted this in the import forum, but it's a bit low traffic.

I'm converting an older version of a database into a newer one that we've developed for a non profit doing fundraising.

The old DB has "home phone", "address phone", and "other phone". The new DB has a 5-field array of phone numbers, and a corresponding popup menu with phone types, including fax, work fax, etc.

Is there any way to map the separate fields from the old DB to be imported into the array? Otherwise, I can only import the home phone, essentially. Can someone let me know if this is feasible with FMP, or if I'm going to have to do this manually (yikes)?

Thanks

If by 5-field array you mean 5 fields, I don't see a problem. Just import and then set the phone type fields with a script. However, if you mean a repeating field with 5 reps, I would set up 5 temporary fields to hold the numbers for the import, then use a script to loop through the records and set them into the repetitions.

  • Author

Yes, it is a repeating field with 5 reps. Can you point me to a code example for a script that does something similar?

Hi,

At first I'd use a calculation to combine your old fields in one with separators.

c_AllPhones =

Choose(Is Empty(HomePhone);"Home"& "

Ok,

I ran a very quick test.

You need a counter say gCounter (num) in this script, that wouldn't show in this layout, and remove the serial from this "Loop layout" so that only the 2 reps in the Tab order defined above are shown.

Show All Records

Go To Record [First]

Go To Layout [Loop]

Loop

GoToField[serial]

SetField[gCounter;0)

Loop

EndLoop If [gCounter = 10]

SetField[gCounter;gCounter+1]

NextField

SetField[ ;

Middle("

Seems like overkill to me. You can easily set data into field repetitions, just specify e.g.:

Set Field (phone type -1, "home")

Set Field (phone -1, home phone)

Set Field (phone type -2, "work")

Set Field (phone -2, work phone)

etc.

I have to wonder why you want to use repeating fields for this, especially since you're using FM7. You could set up the phone numbers in their own table and be totally flexible.

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.