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.

Set field with name from Variable

Featured Replies

I have several fields which get acted on by very similar scripts, with small differences. So I'm trying to make the script as multi-purpose as possible so when I improve it I can just copy it and tweak a couple of lines.

So, among other things, I want it to read the text in the field into a variable, perform a calculation (to strip out unwanted tabs etc) and replace the text.

I have:

Set Variable[$TextToProcess;Value:Get(ActiveFieldContents)]

I would like to then do:

Set Variable[$CurrentField;Value:Get(ActiveFieldName)]

and then

set field $currentField .... to the result of my calculation.

But I can't see any way to put a calculation or variable into the 'set field' (I mean the name of the field, not what to put in it).

Hope I've explained myself clearly, it doesn't look like it to me...

You're trying to Set Field by indirection (or by calculation). Which is perhaps the most requested Filemaker feature. It should be easier than it is, but here's one solution.

  • Author

That's great! You don't even have to 'name' the object. Just saying

Go to Object[ObjectName: $FieldToProcess]

took me to the correct field without fiddling about assigning names via the objects pallette.

My related scripts are brilliant now - only 2 lines different in each one (where the variables are assigned) which makes improving them so much easier.

Thanks.

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.