AnsweredAssumed Answered

From Dialog box: Check if record exists, if not create new record

Question asked by DrBev on Jan 21, 2014
Latest reply on Jan 22, 2014 by philmodjunk

Title

From Dialog box: Check if record exists, if not create new record

Post

     Hello, I am having trouble creating the following script. A similar request was posted in 2002 by someone else, but my request here has some slight differences. I am using FileMaker Pro 12 and developing this database for use in iPhones.

     I have created a vocabulary flashcard database with the fields "word" and "definition". I want to create a script that goes something like this:

     1. User presses a button and the following dialog box comes up:

      "What is the word you want to create a flashcard for?"

     2. User enters text in an input field in the dialog box and presses OK.

     3. Upon pressing OK, the database checks to see if the word exists in the "word" field, ignoring lower/upper case and with the condition that the word exists alone. I wouldn't want a situation where the word "all-inclusive" already exists in the database but when the user wants to create a flash card for "all", the database erroneously says the word "all" already exists.

     4. If the user input word exists in the field "word", then the script pops up another window to say "Word already exists" and returns the user to the original layout and record prior to the user requesting creation of a flashcard

     5. If the user input word does not exist in the field "word", then the script creates a new record AND automatically inputs the word into the field "word".

      

     The script I came up with, which seems to be very problematic is the following:

      

Script.png

Outcomes