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

Get (Container) File Name through (Field) Object Name

Featured Replies

Hi all,

Does anyone know how I can get the name of the file stored in a container, without using a hard-coded field name?

This was my idea (below), but it only returns a "?"

Evaluate(

GetAsText(

Left(Get (LayoutTableName); 3) & " • File1"

)

)

The table I'm working in is named T2B • Artworks, the container field object name is T2B • File1

Any ideas?

I'm trying to have a layout independent script to import/export container field content, which I can use on any layout in any table simply by adjusting the object names of the container fields.

Any help much appreciated!!

Try something like:

GetAsText ( GetField ( Get ( LayoutTableName ) & "::" & "FieldName" ) )

or just:

GetAsText ( GetField ( "FieldName" ) )

  • Author

Right... but then it's tied to the field name. Granted, I could name all fields in all tables which store files of any kind the same way - but it would be much more flexible if I could get the information through the object name of the field. That way I could name the field freely according to their purpose.

Impossible?

OK, then how about:

GetAsText ( GetField ( GetLayoutObjectAttribute ( "ObjectName" ; "source" ) ) )

  • Author

I think you just changed the way I program forever... I was totally unaware of the source attribute for the GetLayoutObjectAttribute function. That is super useful!

Thank you!

I even used $ObjectName for "Object Name" which was previously retrieved as Left(Get (LayoutTableName); 3) & " • File1" - and which makes it entirely portable in my view.

All I have to do now on any given layout is give the media field(s) a name based on the convention above, and I can upload, export, email and delete a media file of any kind and format. Time required? A couple of seconds.

Fantastic :(-)

I don't quite see what role LayoutTableName would play here. You could simply name your object "Container" on every layout, and the formula:

GetAsText ( GetField ( GetLayoutObjectAttribute ( "Container" ; "source" ) ) )

will automatically return the filename of the file stored in the current layout's object.

  • Author

Good point. It can be simplified like you suggest.

If I was putting the information in a global variable for some kind of use, I would need something that identifies what layout a certain "container" is located on. But since this is not the case - you're absolutely right.

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

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.