From the course: FileMaker Pro Essential Training

Using container fields in your FileMaker app - FileMaker Pro Tutorial

From the course: FileMaker Pro Essential Training

Start my 1-month free trial

Using container fields in your FileMaker app

- Container fields are an important building block for any FileMaker custom app in which you want to store and or display more than just text, numbers, dates and times. As a matter of fact, container fields are really the feature that sets FileMaker apart from other database development platforms. And that's because with container fields, you can store and display any binary format that includes digital images, videos, PDF files, anything you want. You can also play back these files like for example, music or any kind of audio file, movie files. You can play those right inside the FileMaker layout in the field. And you can store electronic documents, PDF, Excel, Word, really any binary file format. So these container fields are really versatile and they make FileMaker a great platform for asset management and document management and all sorts of stuff that other database applications have a hard time doing. So we look at our exercise file and we go under the hood real quick to file manage database. We'll see that we already have a container field here and we know that, because when I look in the type column, I see that this one is set up as a data type of container. That of course is one of the defaults and that designates this as a very specific type of field. As a matter of fact, not only on the desktop, Mac and PC does it have various specific type of features but on iOS in FileMaker Go, it has even more compelling features. So container-dated types, not a small thing at all. Let's take a look at how this might work. We've got a container field on our layout. If we go into layout mode, we'll see first of all that it look a little bit different when you're in layout mode. You'll see that you don't have text base lines, you can usually spot a container field on the layout pretty easily as a result. So let's look at what it takes to actually get data inside of the field. Well first of all, we can drag and drop or if you don't have the file close by, you can just right click into the field and select one of the insert options. You can also click in the field and go under the insert menu on the top of the screen. All of this is scriptable through FileMaker Scripting Engine in case you want to automate this as well. So let's do an insert real quick. I'm going to select an image, and the first thing that you'll notice is that we can preview what the image looks like. So the file actually lives inside this database record and there is some limitation to the file size. For example, a file cannot exceed four gigabytes in file size, so that's per container field. So like for example, if I have a company logo, image field, any file in put into that one single field on this one record can be a maximum of four gigabytes in size. It's pretty big actually. The other limitation, which is not much of a limitation, is just that you can only put one file in the field at a time. As a matter of fact, if I try to insert something else into this field, you see that it overrides the previous file. If you have a desire to include more than one file inside of a container field with time, just package them up. Meaning you can zip them up or create a package file and other ways as well. And then take the whole package and put it in the container. Now, how do you get files out of FileMaker? Well, you'll notice that when you have a container field that's populated with some type of file and you right-click on it or you interact with it through a script, the export field contents is the option that allows you to then take the data out of the file and copy it somewhere else. You're not actually deleting the original file, you're just making a copy and sending it somewhere else. And notice that you can automatically open the file, in it's native application, which is kind of a neat trick if you're scripting this or automating this. And then also you can create an email with the file as an attachment automatically right from this dialogue in case that's what you intend to do, in the first place. So when you're planning out your FileMaker application, if you need other types of data besides just raw data, like files or media, then think about container fields because they're very powerful, they're really easy to add and very low maintenace and you can do some really interesting things with your FileMaker application.

Contents