Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Dynamic container field

Featured Replies

  • Newbies

I'm new with FMP, so this may be a silly question - I'm working on an employee database and want to display the employee picture (along w/their personal info.) using a container field. Do I have to insert each employee picture or can I generate a script to automatically populate the container based on url location of the picture. All pics are stored in the same directory and the pic name is username.jpg. I have the username in a different field - so I'm hoping I can pull the picture name and url and somehow populate the container field....

Any advice would be great!

You can fairly easily do this. There are 2 different methods (actually 3, but "import as reference" is not needed much in 7), depending on whether you want to display the pictures as a reference, or actually embed the picture in the database.

In the first method, you'd need a text calculation that resolved to the "relative" location of the picture, which would need to be a volume that was mounted on each client machine (hence OS-shared, therefore not the FileMaker database volume, preferably).

The calculation part is straightforward. It has to look like:

image:/volume/directory path/file

The result is "Container" ("image:" is new to 7).

Second method. For what you're doing, embedding may be a better idea; small pictures, more portable. Since you know the name of the picture's file, you can create a calculation to match in the database, EmployeeName & ".jpg" (or whatever you need to do to match, deal with spaces, underscores if needed), result text.

Then you can use Import Folder, with the option Update Matching Records. You'll be matching the File Name to the calculation above. Import the picture into a container field. You can create and import a thumbnail at the same time.

The 2nd method would require maintenance, if you change the picture. The database would be independent of the picture files after the import. Though you could still use the Import Matching to add new records (remember to Show All first).

  • Author
  • Newbies

I used the second method and it worked perfectly - thanks!

Question, do I need to import each time a new employee starts? or does the container field automatically know where to look now?

thank you!

  • 2 weeks later...
  • Newbies

Fenton,

Do you know of a way to make this work with FM6 ( on Windows )?

Thanks!

When a new employee starts, I would just insert the picture rather then reimporting all employees.

All you really need is a two line script:

Go to Field[Your Picture Field]

Insert Picture

Put a button next to the picture and then when you need to update or insert a picture for maintenance reasons, you just click the button.

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Account

Navigation

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.