1 2 Previous Next 15 Replies Latest reply on Feb 20, 2015 7:44 AM by philmodjunk

    how can I import a dropdownlist in a checkbox field.

    LouisPons

      Title

      how can I import a dropdownlist in a checkbox field.

      Post

      Hi, 

      I'm trying to import a dropdownlist from an old file into a new one where that field is now a checkboxfield with the same values. Problem is that in my old file, when I needed multiple options I just typed the second value next to the first one (by double clicking and typing it). If I import them now, the checkbox list only recognizes the first value, but not the second one. How can I solve that problem? I have 3000 records and I hope I don't need to do them by hand,... ;-) 

      Any answers? 

      Schermafbeelding_2015-02-16_om_13.27.18.png

        • 1. Re: how can I import a dropdownlist in a checkbox field.
          philmodjunk

          Import the data into a table. Then set up a "use values from field" value list to reference that table. Multiple values in the same field will then be individual values in your value list.

          • 2. Re: how can I import a dropdownlist in a checkbox field.
            philmodjunk

            You can also use a script to loop through such a list of values and transfer the data to a new table with one record for every value.

            • 3. Re: how can I import a dropdownlist in a checkbox field.
              LouisPons

              Hi Phil, 

              How would I construct such a script? 

              The problem is that I have an 8 year old database and I build it with little knowledge of filemaker. So the values of that list are not very good. Offcourse I can check them so they will be in order. But transferring them into the checkbox is the mystery. 

              Thanks. 

              • 4. Re: how can I import a dropdownlist in a checkbox field.
                philmodjunk

                After I posted, this, I remembered an non script approach that I've used to turn custom values value lists into field based value lists that can be adapted here.

                Use export records to export the contents of this field to a tab file. It doesn't matter if you are exporting data from a single record or multiple records. Open the resulting text file in a word processor and use its version of find/replace to replace all the vertical tabs, that are exported to separate values within the field, with hard returns (what marks the end of a paragraph in MS Word and most similar software.)

                Save the file as a plain text file, import it back into fileMaker and the imported values will be separated into individual records.

                This is much simpler than a script where you'd need two loops, one inside the other, the outer loop loops through all your records, your inner loop would loop through all the values in the field of that one record with GetValue used to extract each value one at a time...

                • 5. Re: how can I import a dropdownlist in a checkbox field.
                  LouisPons

                  Hi Phil, 

                   

                  thanks. I tried it but something goes wrong. Ik still can't figure out how I can export all the data in my database A tot my database B (since it hase a lot of pictures) with a word file. 

                  Isn't it possible to just import the field with al its values as a drop downlist and make it a checkboxlist in the new database? And then construct a calculation that recognizes all the different values an checks them in de checkbox field? 

                   

                  Louis

                  • 6. Re: how can I import a dropdownlist in a checkbox field.
                    philmodjunk

                    You can certainly import the data into a table and leave the data unmodified, but personally, I'd find the data much easier to manage going forward if each value was in a separate record.

                    Here's a step by step:

                    Go to a layout based on the table where you have these values entered into a field of one or more records. Show All Records.

                    Select Export Records and specify a tab file for export and export select just this one field to export. In my example the data I had to export looked like this:

                    • 7. Re: how can I import a dropdownlist in a checkbox field.
                      philmodjunk

                      I then opened the file in MS word and clicked the pilcrow button to get this image: Note that I have data with manual line breaks between each value from the same record and paragraph marks between the values from each record. (This is a composite image showing details from two parts of the MS Word window.)

                      • 8. Re: how can I import a dropdownlist in a checkbox field.
                        philmodjunk

                        I then selected the Replace tool and used the special characters drop down to find manual line breaks and replace them with paragraph marks. That produced this result:

                        • 9. Re: how can I import a dropdownlist in a checkbox field.
                          philmodjunk

                          I then saved this file as plain text. I opened a FileMaker Database File and defined a new table with a text field to receive these values. I used validation field options to specify "unique values" and "validated always" for this field. I then used Import Records | File to import the text from this text field into this new table. The field options I set filtered out any duplicates so the value Orange is only imported once to produce this end result:

                           

                          • 10. Re: how can I import a dropdownlist in a checkbox field.
                            LouisPons

                            Hi Phil, 

                            I got the tapfile into the new database and it dit separate the values into different records. But then I am stuck and confused,... I get the field in my other table to reference to the just imported table but I can not make it a checkbox field. But then I am still not close to the result I want. I don't need to import the list, I need to import all the records into the new database and only one of the fields will be the checkbox. 

                            I still don't get how I can do that after the procedure you just gave me. 

                            the image I gave you is an example of the record that needs to be imported into the new one. 

                            Thanks. 

                             

                            Louis

                            • 11. Re: how can I import a dropdownlist in a checkbox field.
                              philmodjunk

                              I can't tell what part of this layout is giving you trouble as I don't know which field needs to be set up as a field with a check box format. If you have successfully imported the data back into the file to get a table of values with one value to a record, you are 99% finished with what you need to do.

                              The next steps:

                              Open Manage | Value lists and create a "use values from field" value list that lists values from this new table of values. (I'd put this table of values in the same file as that of the layout you show here.)

                              Then I'd put the field I want to set up with check boxes (NOT the field of the new table but the field in the above layout's table instead) and use the data tab in the inspector to specify a check box format that uses this new value list for it's source of check box values.

                              Design Note: Use values from field is a value list that can create issues for check box formats because you can easily increase the number of values in the value list by adding more records to the table from which the value list is generated, but you cannot increase the size of your field automatically to show the added values, you have manually enter layout mode and edit the design of your layout.

                              But there is a way to set up this same table with something that looks and acts like a check box field, but which comes with a scroll bar so that it can be used with a variable number of "check boxes". Examples of this technique can be found in:

                              "Adventures in FileMaking #2 - Enhanced Value Selection" (Shows different ways to enable a user to select values from a list when a simple value list just won't cut it.)

                              • 12. Re: how can I import a dropdownlist in a checkbox field.
                                LouisPons

                                Hi Phil, 

                                The things you explained me worked out. The result being that I managed to make a checkbox with the exact same values as I have them in my other database. But it works the same as I did before where I just typed the list into a new value list, using the same words. 

                                The problem I am facing and can not seem to solve is when I import an entire record into my new database. All the other field are fine but when I import the field Tag from my old database (which was a dropdownlist where I entered other values next to it by hand) into the new field where I have a checkbox. 

                                It recognizes the right value if there is only one value but when I have more than one value, it does not recognize anything.

                                As you can see in the image I need A to get in to B. B has a more limited list of options but still gives me the same opportunities.

                                Thanks. 

                                Louis

                                 

                                • 13. Re: how can I import a dropdownlist in a checkbox field.
                                  philmodjunk

                                  In order for a check box value to show as selected the exact value specified for that check box must be in the field. If there are multiple values selected each such value must be separated by a return. Any data present in the field that does not match one of the values specified for the value list will not be visible, the check box formatting will conceal it. The presence of a space in the field or the value list can also keep a check box from displaying as selected even though it looks like you have the correctly matching data present in the field. The field should also be defined as a text field and not a number field.

                                  To see what data is actually present in the field--a good way to figure out why a particular check box does not show as selected when you expect it to be, is to put a copy of the field on your layout with it formatted as an edit box but sized to be multiple rows of text in height.

                                  • 14. Re: how can I import a dropdownlist in a checkbox field.
                                    LouisPons

                                    Hi, 

                                     

                                    I see now that It will be a lot of work to make sure that all the data is correct. One more thing that might help me. If I only want to look for the record that have the unique value of actor and I don't want the record with for example : actor featured model to show up. How do I do that. 

                                    This would make is possible to do a replace field content. And do large groups at the same time. 

                                    I can find the group actor featured model and make them 

                                    actor

                                    featured

                                    model

                                    Would that be a way to do it? 

                                     

                                    Louis

                                    1 2 Previous Next