4 Replies Latest reply on Apr 10, 2012 6:29 PM by hobbiesdeveloper

    Field Drop Down List Values

    hobbiesdeveloper

      Title

      Field Drop Down List Values

      Post

      Hello,

      I'm trying to make a text field drop down list to only use existing values in the list i have setup for it but when I import the records using the function inside a script it doesn't check for existing values inside the drop down list values and creates a new one if there is no matching fields found.

       

      At this point I have a category text field drop down list with 15 values and Validation set to Require: Existing Value. When I click on New Record and type in a value that is not from a value list it will give me a warning stating that the text field is defined to contain existing values only and if I would like to add this new value to the list or not but with an automated script import records, it doesn't show me anything.

       

      I'm doing this so that when I'm importing products from a file i will only be able to use existing values inside the system and not be able to create new onces when importing.

       

      Please let me know what's the best way?

       

      Thanks.

        • 1. Re: Field Drop Down List Values
          philmodjunk

          Hmmm, I don't think you want your import process to halt in mid import, display an error message and give you options for what to do. And that can't be set up to work that way anyway unless you were to import a single record at a time.

          What you can do is do a "post import processing" of your imported records, bringing up those that have this issue one at a time for your response or you can script the process to add your new values automatically with no user import.

          Import records produces a found set of all the newly imported records so you can have your script loop through these records checking the value in this field against the values in your value list:

          Go to Record/Request/Page [first]
          Loop
             If [ IsEmpty ( FilterValues ( ValueListItems ( get ( FileName ) ; "YourvalueListNameInQuotesHere" ) ; YourTable::YourDropDownField ) ) ]
                #Put steps to handle record with value not in value list here
             End If
             Go to Record/Request/Page [next ; exit after last ]
          End Loop

          If any of the functions inside that If step are unfamiliar, I suggest looking them up in FileMaker Help to learn more about how they work.

          • 2. Re: Field Drop Down List Values
            hobbiesdeveloper

            I will give it a try.

             

            Thanks.

            • 3. Re: Field Drop Down List Values
              hobbiesdeveloper

              Would you use this process after you have imported the records which will than show up just the found records?

               

              Would I use this after the new Records have been created?

              Go to Record/Request/Page [first]
              Loop
                 If [ IsEmpty ( FilterValues ( ValueListItems ( get ( FileName ) ; "YourvalueListNameInQuotesHere" ) ; YourTable::YourDropDownField ) ) ]
                    #Put steps to handle record with value not in value list here
                 End If
                 Go to Record/Request/Page [next ; exit after last ]
              End Loop

              • 4. Re: Field Drop Down List Values
                hobbiesdeveloper

                It worked.

                Thanks.