10 Replies Latest reply on Dec 1, 2016 5:24 PM by JackRodges

    Question about 'condensing' container fields

    longball22

      Hello

       

      I have a form that users will fill out using FMGO on my database. They have the possibility of adding a photo to a container field in every single question in the form.

       

      The problem I am having is I want to have a summary layout that shows all of the photos they have added in a viewer friendly format (for each record). So instead of having a copy of each container field in a grid format, as shown below in the first photo, I would like them to show in the format of the second photo.

       

      For example, if there are 10 questions and 10 container fields, and the user submits a photo for questions 1, 4, 6 and 8 (like the 1st graphic below, if question 1 is the top left, question 2 is top middle, question 3 is top right, question 4 is middle left, etc.) I want the photos to show like the 2nd graphic shows.

       

      (I apologize for my terrible graphic but its the best I can think of.)

       

       

       

      1st graphic is NOT what I want

      fmbad1.png

      2nd graphic is good

      fmgood.png

        • 1. Re: Question about 'condensing' container fields
          beverly

          do you have a sort order to the images on that layout?

          beverly

          • 2. Re: Question about 'condensing' container fields
            longball22

            I'm not sure exactly what you mean. I want to sort the photos in each record, not all of the records combined. So if one user inputs 10 photos in one record, I want all those 10 photos to show at the top.

            • 3. Re: Question about 'condensing' container fields
              erolst

              longball22 wrote:

              So if one user inputs 10 photos in one record, I want all those 10 photos to show at the top.

              I was afraid you'd say that ... having 10 fields with identical meaning is not a good database design.

               

              Use a related Photo/Image table instead. That allows you display just the photos you have, and there is need to deal with "gaps" because by definition, each of those related records every has a photo.

               

              Now you could use a list layout with several columns and the direction 'across', or even several portals.

              • 4. Re: Question about 'condensing' container fields
                longball22

                So in the related table, there could theoretically just be 2 fields. 1 for the relationship, and 1 for the photo and each photo that is inserted in the form by the user is just a new record in the related table? I wouldn't have had an issue doing this with text, but for some reason, using photos has thrown me off.

                • 5. Re: Question about 'condensing' container fields
                  erolst

                  longball22 wrote:

                  So in the related table, there could theoretically just be 2 fields. 1 for the relationship, and 1 for the photo and each photo that is inserted in the form by the user is just a new record in the relationship?

                  Theoretically yes, that's about it. (But make that three, because every table should have its own primary key.)

                   

                  Once you have the images nicely stashed away, you can do all sorts of nice things with them - using portals, list layouts and/or repeating fields - many of which are difficult to achieve with multiple fields in a record.

                   

                  And it doesn't really matter whether you store text or images in a related file; the set up of the relationship and the handling of the records are the same.

                  • 6. Re: Question about 'condensing' container fields
                    longball22

                    Thanks for the info.

                     

                    The layout has many questions, and if they user selects 'No', then the container field pops up and the user has the choice to insert a photo (for each question, up to 1 photo per question).

                     

                    Is there a way to have a 'preview' of each and every photo that the user inserts if the photo is stored in a related field without using a portal?I'm not sure it would work the current way I have it set up without using a portal and with using a related table.

                     

                    Capture1.PNG

                    • 7. Re: Question about 'condensing' container fields
                      philmodjunk

                      You aren't limited to a single relationship between this layout's table and your table of photos. You can create an additional occurrence of your photos table and link it's Primary Key field to a global field in the layout's table. To do a "preview" of that photo, A script can set the global field to the photo's primary key and then this additional relationship can be used with a Popover or a dedicated layout to show this selected photo.

                       

                      PS. This looks like a layout that should be a list view layout where every question is a different record and the responses are then recorded in yet another record linked to both the question being asked/answered and the person (or company or site...) answering the question. You might want to search this site for threads dealing with Questionnaires to see more about how you might structure such a database.

                      • 8. Re: Question about 'condensing' container fields
                        JackRodges

                        Consider using an inbetween table to display the photographs, you can drag related data from the other tables onto it.

                         

                        It will contain 11 fields, one being the main record and the other 10 for the photos.

                         

                        The script fills in the main record linking id and then loops through the related photos inserting them in the linking id fields. Thus the photos will appear at the top rather than scattered.

                         

                        Main table<--->In between <--->Photo (create 10 TOs, one for each place holder)

                         

                        Now drag a container photo for each TO onto the layout and position them.

                         

                        Just step thorugh the main records and run the script on related photos. Since you are only dealing with record links its fast and using the second table doesn't modify your original data, most important.

                        • 9. Re: Question about 'condensing' container fields
                          erolst

                          gofmp wrote:

                           

                          Main table<--->In between <--->Photo (create 10 TOs, one for each place holder).

                          Rube Goldberg is dead, alas.

                           

                          If you really need placeholders, there are great things you can do with repeating fields, without copying images all over the place

                          • 10. Re: Question about 'condensing' container fields
                            JackRodges

                            Rereading my post, I said to drag the container from FROM the related table not copy the container data. This is a related database application.

                             

                            Good to see ya again.