1 Reply Latest reply on Feb 22, 2013 7:32 AM by philmodjunk

    Creating a keywords field



      Creating a keywords field



           I would like to add a keyword field into my database. Ideally, this will be a single field which can contain several different keywords to assist with searches. I would like the user to select the keywords from a set list to ensure consistency.

           While a checkbox field would work, with 50+ keywords to choose from this would take up far too much space on the form. Equally, you can use Ctrl+click on a drop down menu to select multiple options but that is far from ideal.

           I currently have the keywords in their own table, each with a unique ID. We have also tried using a portal on the project table, however every time a keyword is selected it creates a new duplicate entry on the keyword table. If I disable the option to create new entries, the keywords do not show up in the portal at all. I feel like there must be a much simpler/neater way of doing this?

           Any suggestions are greatly appreciated! 

        • 1. Re: Creating a keywords field

               The portal would sound like the way to go here, but what you describe indicates problems with how you set up the portal. Selecting a key word in the portal by clicking a button in the portal row should not automatically create a new record in that portal. Nor should disabling "allow creation" prevent records from appearing in the portal.

               Typical relationships between a keyword table and your main table should be similar to this:


               MainTable::__pkMainTableID = MainTable_KeyWord::_fkMainTableID
               KeyWords::__pkKeyWordID = MainTable_KeyWord::_fkKeyWordID

               The extra table is needed to facilitate a many to many relationship since a given keyword can be linked to multiple MainTable records and a given MainTable record can be linked to multiple keywords. Your portal would be to either KeyWords (read only) or MainTable_KeyWord ( Can be edited to add remove links to keywords.)

               And your list of keywords can be given a checkbox like format with a bit of scripting and conditional formatting.

               See the first post of this thread for an explanation of my notation: Common Forum Relationship and Field Notations Explained

               To download a many to many demo file (includes a checkboxes example), click: https://www.dropbox.com/s/oyir7cs0yxmbn6i/ManyToManywDemoWExtras.fp7