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

GetField() and variables

Featured Replies

Does anybody know why GetField("FieldName") returns the quoted field's value but GetField($$globalvariable) will not, even though $$globalvariable contains the exact text string "Fieldname", quotes and all?

  • Author

By the way, GetField() using the variable returns "?"

It works for me. you might check that the variable is set in the table where the GetField() is used and make sure the field type is appropriate.

  • Author

I'm sorry, I don't understand what you mean by the variable being "set in the table where the GetField is used"

Global variables are Global, right? They do not belong to any table. Their value stays the same until reset, right?

Sorry, I should have said "file" instead of "table". Global variables are specific to the file they are set in.

  • Author

Right... yes, same file. GetField can use related fields can't it? I thought that might be it. But I tried an end run by creating a calculation that returns the related value but still no luck...

BTW, the "?" that is returned is in the Data Viewer

Can you describe the relationship and field or script this is used in? Or better yet, post a sample that illustrates what you're trying to do.

  • Author

The attached is very simple but does show the problem. Try running the SetVariable script while using the dataviewer to watch:

$$variable

GetField("subchild::subchildvalue")

Child::Getsubchildfield

You'll see that while the straight formula returns the correct value, the calculation in the Child table does not even though it is looking at $$variable which contains the exact same text as the straight GetField formula.

Thanks for your time, Ender!

PS: the text editor is adding a space in one of the watched items when I preview the post and I can't seem to get rid of it

test.zip

Remove the Quote() function and change the storage on the GetField()'s calc to "Do not store".

Alternatively, you could have the script perform the GetField(), setting the calculated result into a normal text field.

GetField( GetAsText( $$variable))

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.