Jump to content

Import into repeating field


Charles Henebry
 Share

This topic is 5570 days old. Please don't post here. Open a new topic instead.

Recommended Posts

I'm an experienced hobby-level user of FM, and I've developed a complex relational database to keep track of D&D 3.5 character information (equipment, spells, etc.).

One part of the database system (three tables and a number of scripts) would be a LOT simpler if I used a single repeating field in each of them rather than (as at present) 10 separate fields in each table. But here's the trick: one of these tables presently has 358 records, so I need a means to populate the new repeating field from the 10 standard fields—whether by exporting and then importing or with a script.

Past experience has shown me that, often, the simplest way to do big data conversions in FM is to export and import. But I find that FM (at least in version 7, which I'm using) doesn't give very sophisticated treatment to repeating fields in the import dialog box. I'm expecting an option which would allow me to designate data to flow into each of the field's separate repetitions. But that's just not an option.

So I imagine a purpose-written script is the best way to do the conversion. But before charging in, i thought I'd write you folks to check how the pros handle this situation.

I DID do a search before posting, but, in all the posts I found, the questioner was using repeating fields to store information that should have been set up relationally, and so was instructed to restructure his/her database and not use repeating fields. (Excellent advice, but not relevant in my case. I have 35 tables in this database and I know what I'm doing when it comes to setting up relationships.)

Thanks for any help!

Link to comment
Share on other sites

Create a loop. If Field A is the new field with the repetitions and Fields B throug K are the ten separate fields you already have and all are on the same table . . .

Go to record (first)

Loop

Loop

Set Field (Field A; Field :

Set Field (Field A [2]; Field C)

Set Field (Field A [3}; Field D)

etc.,

End loop

Goto record (next, exit if last)

End loop

I can't remember if your version of FIlemaker allows for the use of the "set variable script." If so, there are other options to set a variable to set a specified repetition.

Edited by Guest
Link to comment
Share on other sites

  • 2 weeks later...

I have the same problem as charles and the loop suggested by Jeff didn't work.

I have Non-Repeating field data in one file (FP7) that I need to import into a repeating field in another FP7 file.

I dread doing it manually...any other suggestions?

Link to comment
Share on other sites

Thanks, Jeff. But unfortunately it still didn't work. I DON'T think the problem is in the formula. I think the problem is with me. But kindly explain to me step by step because I am not an expert. Your solution doesn't contain the "IMPORT" command in the script, Why?

Here's the issue...I have created a "Training Events" Filimaker program in FP7. Two linked files. One file is called "TRAINEES" with a layout called "Training History", and the other file is called "EVENTS".

The "EVENTS" file contains the name of a training event in a single field "Event Name" and multiple trainees in a repeating field for those who attend each event. I now want to automatically update the trainees history of attending the events.

The History layout in the "TRAINEES" file contains a repeating field that holds multiple training events.

I need to import the "Event Name" to each trainee's history. So I am importing a single field into a repeating field when the registered trainees in the "EVENTS" file matches the trainee's name in the "TRAINEES" file.

I apologize if this sounds confusing. Can you help?

Link to comment
Share on other sites

Hi Gersam,

Note that it's typically not best to use repeating fields for anthing BUT unchanging storage. I'm guessing that you might need to rearrange your relationships.

Post a copy of your files (preferably with only a few entries to save space but show us the relationships, etc.) and we'll see what we can do. Also note the layouts that you want to "see" when everything is in place so we know what you are looking at (can I use "at" the end of a sentence?)

I can't necessarily guarantee a prompt answer but I'll do what I can and hopefully someone else will come along if I'm absent for too long.

Link to comment
Share on other sites

This topic is 5570 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

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