AnsweredAssumed Answered

Auto-populate portal rows with new records?

Question asked by indyj on Jun 25, 2014
Latest reply on Jun 26, 2014 by philmodjunk


Auto-populate portal rows with new records?


     Hi all,

     I am new to FM, so I hope this is not too stupid of a question: 

     I am trying to populate a portal based on one table with a new record for each non-empty field from another table, but I can't figure out how to do it. 

     In brief: I have a database of skeletons and each skeleton is identified by a unique SkeletonNumber (the main DB key).

     I have a table called SkeletalInventory, which has fields for each existing bone of each skeleton - they contain entries such as "Humerus Left", "Humerus Right", "Mandible", and so on (there are 81 fields in this table - 80 inventory fields and the key field). All the inventory fields are displayed on a layout. 

     On the same layout, I have a portal to the table "BoneElements". This table only has two fields: "SkeletonNumber" and "BoneElements". They are related through the "SkeletonNumber" field. 

     Now, I would like to auto-populate the portal with a record/row for each field in the SkeletalInventory table that is not empty. In other words, if skeleton 1001 has entries in the fields for "Humerus Left" and "Mandible", I would like the portal to display two rows like this:

SkeletonNumber       BoneElement

     1001                            Humerus Left

     1001                            Mandible

     Is this possible? 

     BTW, the reason I need this is that I want to make a value list based on the portal, so that a drop down list in another table only displays the existing bone elements of any given skeleton. For example, when I go to the Pathologies layout (which has the SkeletonNumber field from the base table in the header), I have two fields: "Pathological Bone Element" and "Description". If I were to go to SkeletonNumber 1001, I would like a value list for the field "Pathologicall Bone Element" field that only displays "Humerus Left" and "Mandible". This seems to be working when I enter the values in the portal manually, but I was hoping there was an automated way. Any suggestions are welcomed!