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.

Get FieldName of Current Calculation

Featured Replies

Hopefully I'm missing something easy here.

I want to get and use the current "FieldName" in the Define Fields as a Calculation. I want the calculation to run some logic depending on what the field name is. If I change the field name, in Define Fields, then the calculation may run some different logic. Does that make sense.

I'm aware of Get ( ActiveFieldName ) but the field has to be on a layout with a cursor in it. Also the FieldNames(...) function only gets all the fieldnames and not just the one that is crunching the current calculation.

Hopefully it is simple like an "=" sign or something and the calculation will return the "FieldName"... I can probably figure another way to do what I want to do, but getting the fieldname in this particular project would be the cleanest way.

Thanks

Dana

If I understand correctly, you want the result of a calculation to depend on the name of the calculation field where the calculation resides?

If so, the short answer is no.

The long answer is what for? After all, as you say, you would need to go to Define Fields in order to change the field's name. While you're there, you can change the formula as well. So what would be the purpose?

There are many ways to make the result of a calculation dynamic, but this is not one of them.

  • Author

Your correct. It would be similar to Get(CalculationRepetitionNumber) except would be named "Get(CalculationFieldName)".

If this would be for one field, then yes it would not be worth it. I could just change the calculation the same time as when I change the field name. In this particular project I have a table that has about 150 fields with similar names. I wanted to create the same calculation and copy into each field but the result would be based on the field name. One step further I was going to create a custom function that accepts the field name as the parameter and returns the result based on the field name. That way if I had to change the calculation I could just change it in the Custom Function and it would automatically affect all 150 fields.

All well, I've already started to do this a different way... but Get(CalculationFieldName) would have made this much easier.

Thanks

Dana

  • 4 years later...

I'm in a similar situation, I wish there were a get(calculationfieldname). My situation is that I have fields named the same way in 3 DBs, and depending on which index field is filled in, I want to get the contents of the field from DB1 or DB2. Of course there are other ways to get the results I need, but calculationfieldname would be much easier to implement across many fields.

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.