Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 7380 days old. Please don't post here. Open a new topic instead.

Recommended Posts

  • Newbies
Posted

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!

Posted

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).

  • Newbies
Posted

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...
Posted

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.

This topic is 7380 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

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