5 Replies Latest reply on Feb 20, 2015 6:17 AM by philmodjunk

    Simple relationship

    birdseyedavis

      Title

      Simple relationship

      Post

      This an attempt at building my first simple relationship. I understand that the fields have to have like criteria. So I copied the database on the left ("Inspection") and created a database called "Lat Long". I then removed all unwanted fields from the "Lat Long" database, renamed the remaining fields and then imported some  data into the new "Lat Long" database. No problem so far.

      Then I go to the first database ("Inspection") and import records from the second database ("Lat Long") and create a new table along with it ("Lat Long").

      Next I create a simple relationship (see image attached).

      So I am expecting the "Name" field from the "Lat Long" table to populate in the "Manhole Id" field from the Inspection table (so then my inspection table would have 114 records) But this is not happening. vice versa, I am expecting the "group" field to be populated in the "Lat Long" table when I change the "Inspection Status" field in the Inspection table.

      I am not sure I am clear, but any help would be appreciated and I can add any further info as requested.

      thanks,

      Larry

      Inspection.jpg

        • 1. Re: Simple relationship
          philmodjunk

          Your terminology is a bit confusing as there is no "group record" in your screen shot but rather a Group FIELD.

          The names shown in your screen shot suggest that you have not linked these records by true matching values.

          Manhole ID in the first table matches to Name in the second table?

          And the value of Inspection Status matches to the value of Group?

          That doesn't seem to really match up value just by the field names that you've specified here.

          I'd expect to see this relationship instead:

          Inspections::ManholeID = LatLong::ManHoleID

          • 2. Re: Simple relationship
            birdseyedavis

            Thanks for the help.

            I have edited the post to remove the word record and replace with field. Sorry about that, I know the difference but just got jumbled up.

            I want to keep the Manhole ID field as is in the Inspection table and leave the Name field as it in the Lat Long Table. The Lat Long Table already has 114 records that contain the Name, the Lat, and the Long fields already populated and the group field is unpopulated. I want the Name field in the Lat Long Table to populate the Manhole Id field  in the Inspection Table. As I do my inspection for each Manhole in the Inspection table, I will change the inspection status field. I then want that inspection status field in the Inspection Table to populate  the Group Field in the Lat Long Table.

            I am doing this so that I can use the Lat Long Table to populate points in some mapping software that uses the Name, Lat, Long, and Group field names.

            Maybe there is a better way.

             

            • 3. Re: Simple relationship
              philmodjunk

              It seems that you want to use a land line to call the telephone company in order to inform them that your land line isn't working laugh

              Since it's the ManHoleID to Name relationship that links the records in the two tables, you cannot use the same relationship in order to populate the ManHoleID field with a matching value from Name in a LatLong table. The relationship has to work before you can autopopulate, but you have to autopopulate before the relationship can work.

              At least you can't do this for existing records in the inspection table.

              You could enable "allow creation of records via this relationship" for the Inspection table and then a portal to the inspection table placed on a Lat Long layout could be used to create new inspection records that are automatically linked to the current Lat/Long record.

              PS. seems really, odd to refer to manhole covers by a "name" and using auto-entered serial IDs or UUID's makes a lot more sense for linking these records.

              • 4. Re: Simple relationship
                birdseyedavis

                I guess you are right about calling the phone company to tell them my phone is not working!

                I guess I don't understand relationships.

                I went ahead and imported the data in the Inspection Table for the Manhole Id field. So both Tables have the same unique identifier.

                Which I guess is my Primary Key? Which I have already been provided the Id, lat, and long. I am using my inspection table to perform a inspection on the manhole. then I wanted to push the inspection status to the lat long table into the group field.

                Then I was going to try to use all the fields from the lat long table to create a map on batchgeo. The map would use the Name/Manhole id as its name and then the group would be inspected or cannot locate. so that way I could keep up with which man holes are missing in map form.

                I went ahead and portaled the lat and long from the Lat and Long table over to the inspection table and I will try to push field data from the inspection table to batchgeo to create the map. All this is assuming I can actually create the scripts to push to data. Which is a big if!

                thanks for the help.

                 

                 

                • 5. Re: Simple relationship
                  philmodjunk

                  Such an identifier is typically a "unique identifier" in one table but not both. If the value of the field is always unique in both tables, you don't actually need two tables, you can set up a single table that combines the fields from both.

                  If you populated both tables by importing data into them, what you have set up should work, but only if matching data was also imported into both the manhole ID field in inspections and the Name field in LatLong.