Jump to content
Salesforce and other SMB Solutions are coming soon. ×

Importing a Value List?


jmille44@mac.com
 Share

Recommended Posts

I have an older FMP database with 2 different value lists containing about 20 items each in check box format.

 

I want to import these 2 different value lists into a new database.

 

The new database has 2 value lists but I have combined a lot of the check boxes and want to import the old list into the new changed list.

 

Is there anyway to import the old value list with the new one and match up the check box items in each value list so the import goes how I want?

Link to comment
Share on other sites

It appears from the way your question is worded that you think of the value list and the field contents of a field that's formatted with the value list as if they were the same thing. They aren't. For the data itself, it will all come over when you import the data from field to matching field.

 

For the value lists themselves, though...

 

I take it these are "Custom Value Lists", not value lists derived from field contents?

 

The manual method:

 

Open old solution. Open Define Value Lists. Open the value list in question. Select All. Copy. Open new solution. Open Define Value Lists. Click New button. Give Value List an appropriate name. Paste from clipboard in the big box where the values are entered. Click "OK".

 

 

The automatic method: Open the old database in the same version of FileMaker Pro that you use for the new db. Convert the files if necessary. Create a script in the old database that sets a global field to ValueListItems(Get(filename), "". You can do this as a looping script, getting the unabridged list of all value lists first and then looping through each value in a variable and running ValueListItems on it.

 

In the new database, make a script that opens Define Value Lists. Opening that pauses all running scripts while you do things, and what you do is make a new value list, paste from clipboard, and click "OK" and exit Define Value Lists, which lets the script resume. You call this script as a subscript within the looping script in the old file. Neat, huh? But probably not worth the trouble unless you expect to be doing this over and over again. (e.g., you sell MySolution.fp7 to 8 customers and periodically you change & improve the database and then need to upgrade all your customers to the latest version, and of course want to preserve all their custom value lists)

Link to comment
Share on other sites

I tried the method of copying over the old value list items to a new database and it worked. I want to rename and combine some of the value list items.

 

For example I have the following value list items:

 

payroll

office

graphics

hr

mktg

pr

sales

 

Is there a way to combine some of the value list items like:

 

payroll/office

hr/sales

 

Would this reatain the check marked items?

Link to comment
Share on other sites

Well, a value of "payroll" will not be seen by FileMaker as the same as a value of "payroll/office", and neitehr will a value of "office".

 

So you'd have to script a change in actual field values — here's a routine that should avoid getting "payroll/office" in the field twice for records that have both "payroll" and "office" currently checked:

 

Go to Layout ["Layout containing field using ValueList"]

Show All Records

Go to Record/Request/Page [First]

Loop

..If [PatternCount(Table::Field, "payroll")>0]

....Set Field [Table::Field, Substitute(Table::Field, "payroll", "p/o")]

..End If

..If [PatternCount(Table::Field, "office")>0)

....Set Field [Table::Field, Substitute(Table::Field, "office", Case(PatternCount(Table::Field, "p/o")>0, "", "p/o"))]

..End If

..Set Field [Table::Field, Substitute(Table::Field, "p/o", "payroll/office"]

..Go to Record [Next, Exit After Last]

End Loop

 

Then of course you change the value list itself. (Or change the value list first and then run the script, order doesn't matter.)

 

 

Use same logic for the "hr/sales" combo.

Link to comment
Share on other sites

 Share



×
×
  • Create New...

Important Information

Terms of Use