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.

Insert Picture - calculating the referenced path

Featured Replies

  • Newbies

I've been using/programming with Filemaker for a while, but I need help on how to do something.

I want to fill a container field in a record with a picture. Normally, I would do this with the "Insert/Picture" menu item and have it stored as a reference. Each container's reference could be from anywhere on my hard drive - not necessarily a single folder. However, the picture will never move once referenced.

Once this picture is referenced by my database, I want to have its absolute path as text. I can then use this text to attach an original file to emails, etc.

What type of script/function/etc. can do this? I only see Filemaker solutions for this by importing an entire folder's contents at once - not by inserting a single photo.

Help!

Thanks.

Grabbing the path out of a Container field is actually quite easy. All you have to do is create a calculation with a text result and it will display the path. You could create the calculation in a script as well.

To create an email, try this script:

Set Variable [$Path; Value:MYTABLE::ContainerField]

Send Mail ["$Path"]

$Path is used in the attachment portion of the Send Mail script step.

You can script your Insert Picture. There is a script step. So you need to go Go to Field [yourfield] and then Insert Picture [].

You can extract the path if stored as a reference by using:

GetValue ( GetAsText ( test ); 3 )

  • Author
  • Newbies

Thanks for the input from both of you. I've tried these, and neither will give me the full path. Both will return only the filename.

Actually, the GetValue ( GetAsText ( test ); 3 ) will not return anything. Changing the last value to 1 will then return the filename.

I need something that would return something like this:

Drive:Folder:Folder:picture.jpg

If it matters, I'm using Filemaker Pro 8.5v1 and its on a Mac, System 10.4.9.

Both will return only the filename.

That will happen if you insert the actual picture into the container, instead of selecting 'Store only a reference to the file'.

  • Author
  • Newbies

Could have sworn I hit that button! That did it. Thanks for the help!

rcscalebuilder:

Could you please post exactly how you got this calculation to work? I tried it as mentioned above (the GetAsText function) but, depending on the type of file in the container, it seems to return different information such as the filename or the file size.

For me, when I use this function, if I insert a file called "document.doc" into the container, then only the filename "document.doc" is displayed in my External Path field, which is calculated using GetValue(GetAsText(container);1).

If I insert only a reference to the file, the output of the GetValue function changes to "file:document.doc". It doesn't actually display the full path.

Any idea why? Ideally what I would like is the output to be "Driveletter:Folderdocument.doc".

Hi Mike,

This may seem like a dumb response,

It doesn't actually display the full path.

Any idea why? Ideally what I would like is the output to be "Driveletter:Folderdocument.doc".

How big is your field? If you click into it, does the whole path show up?

Lee

Hi Lee

Right after I posted I figured out my problem. The text output from the container field is two values: the filename first, followed by the full path. You have to expand the field in order to see the whole thing.

I used the following calculation to grab the path name and report it:

=Replace(GetValue(container;2); 1; 9; "")

Explanation for others reading this:

The GetValue function pulls the full driveletter/path/filename information for the file in the container field called "container". Since the full path information is the second value returned by GetValue, the parameter 2 is specified. The path is returned in the format: "winfile:/C:/Folder/Filename.doc". (If you're on a Mac, I think it returns "macfile:/.....".)

Since I didn't want to display paths with "winfile:/" at the beginning, I nested the GetValue function in a Replace function that replaces the first nine characters of the returned path ("winfile:/") with nothing ("").

Works like a charm. Note that you MUST insert a reference to the file and NOT the actual file itself in the container for this to work.

Create an account or sign in to comment

Important Information

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

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.