9 Replies Latest reply on Apr 25, 2015 8:20 AM by Jason_Farnsworth

    Using a fields content w/in a text field

    Jason_Farnsworth

      Hello all,

       

      Can I use a text field as such:

       

      This project is located in Odessa, Tx and is called <<JOB_CGP_SWPPP::Project_Name>>. The TPDES Authorization number for this project is <<JOB_CGP_SWPPP::TDPES_NO>>.

       

      I would like for the appropriate field to fill in the blanks where necessary. The above is written within a text field related to the current table.

       

      Is it possible?

       

      Jason

        • 1. Re: Using a fields content w/in a text field
          Mike_Mitchell

          Assuming I understand what you want, yes, you can do this. There are a couple of ways:

           

          1) You can write a script that inserts the data into the text field at the current cursor position and use a button to trigger it.

           

          2) You can use markup such as what you've done (although I'd avoid the double-carat nomenclature). Then, use an auto-enter calculation and the Substitute ( ) function to push the data into the field. Something like this:

           

               Substitute ( {yourField} ; "{{projectName}}" ; JOB_CGP_SWPPP::Project_Name )

           

          HTH

           

          Mike

          • 2. Re: Using a fields content w/in a text field
            siplus

            As Mike says, I'd use a script for that. A bit more generic, though, allowing unlimited fields. I'd use « and » as field delimiters. Will write something implementing it right now.

            • 3. Re: Using a fields content w/in a text field
              erolst

              siplus wrote:

              Will write something implementing it right now.

              No rest for the wicked nerds …

              • 4. Re: Using a fields content w/in a text field
                siplus

                Here you go

                 

                For now, you have to end the template with a «».

                 

                Fixed.

                • 5. Re: Using a fields content w/in a text field
                  siplus

                  added a button for inserting (using a wicked method you might appreciate) any table field into the template text field, at cursor position.

                  • 6. Re: Using a fields content w/in a text field
                    siplus

                    btw, you can also insert function calls into the template text, like «sin(random)».

                     

                    And no, it won't output a random sin, but it will evaluate

                    • 7. Re: Using a fields content w/in a text field
                      Jason_Farnsworth

                      Interesting approach, I think in this case my needs are better suited to another method as I have a about a 20 page book that needs to be writtens as such with lots of calls.

                       

                      My basic need is to create a custom document for a project that has all the same basic boiler plate text, and within the text I have embedded unique fields that make the document cater to one project or the other. (ie location, size, contractor)

                       

                      Currrently I have created a large calculation field that handles the full document, that said I wanted to slice it up into smaller pieces for easier editing down the road. (ie section by section)

                       

                      Jason

                      • 8. Re: Using a fields content w/in a text field
                        siplus

                        Calculation fields will destroy any formatting (bold, size etc ) in the original template, while my solution will not. This was one of the basic requirements I imposed to myself. Of course, the merged data will not copy the formatting from the preceding word, but it's still a step forward.

                         

                        I probably did not understand your needs fully but the request for such a solution came some months ago from a client of mine; I forgot about it and I am grateful that you gave me the opportunity to remember about it and the stimulus to work on it.

                         

                        As of your original question, the answer is "yes", and you got proof of that.

                         

                        About your 20 page book, Filemaker states that the limit for a text field , version 13, is

                        Text: < 10,000,000 characters per field per repetition (limited by available memory)

                        and the only problem you might have with a 10 mil-length text field, being a book, is not its size but merely the fact that nobody will read it.

                         

                        Peace.

                        • 9. Re: Using a fields content w/in a text field
                          Jason_Farnsworth

                          Ha,

                           

                          No one will read it for sure! It is government documentation that is mandated and must be turned in on every project. My view is why not just make a great template, have everyone fill in the blanks and stop pay big bucks to engineering firms to do just that.

                           

                          The additional benefit of me doing it is that I can expect the result of the document and not have to read 1000's of them generated by whom ever. I can also kill the paperwork trail and make it all digital via web direct.

                           

                          I did like your solution and have an element I would like to utilize it on

                           

                          Jason