1 Reply Latest reply on Jun 26, 2017 9:11 AM by philmodjunk

    Using a path to populate a container


      Using FM16 for Mac. I have a table of a number of paths, and at the end of the path is a document (PDF, Excel, MP3, it varies). The original path is to a server but I can pull these down to my Mac and it would't make any difference.


      What I'd like to do is populate a field with the paths, one path per record, and have the container show the file. I could easily separate them (the target files) into images and interactive, but optimization is not important and only a still image is needed. I have tried setting the container to some calculations, but I can get only manual methods to work.


      There are the scripts "insert from URL" , insert PDF, and others, but those end up showing just an icon (from a server) and, from desktop, connection cannot be made. And of course, it's an execute-per-record.


      Finally, I'd rather point to the document, not embed.


      Any ideas? Thanks.


      Message was edited by: Tim Murray. Changed FM15 to FM16.

        • 1. Re: Using a path to populate a container

          In 15, you can use the "store a reference" option when inserting the file into a container field.


          Your script can check the file extension and use the correct insert method for the type of file, using insert file for text files, insert picture for image files and insert PDF for inserting PDF's into an interactive container field for example.


          You could also define a calculation field with "container" as the result type that uses your text field's file path, but you'd need to study the full text inserted "by reference" via the different insertion script steps for the different file types and build that into a case function. Note that GetasText ( containerField ) will return the full contents of the text you need to reproduce if you want to check this in the data viewer.


          For image files and PDFs, many developers use the path with a web viewer.