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 Function w/ Field Names As Values?

Featured Replies

So this might be a bit hard to explain but let me give it a go. I have a search interface in which you type the text you're searching for in a global field called "g_SearchText" and there's another global field (formatted as a pull down menu) called "g_SearchCriteria" where the user chooses in which field they will be searching. Now, in scripting the search I am trying to use the SetField function to put together a find based on the user's request. The function looks like this: SetField["g_SearchCriteria" , "g_SearchText"]

Here is the problem that arises:

When I use the SetField function to put the text from g_SearchText into the appropriate field, the function wants to set g_SearchCriteria rather than the field specified by g_SearchCriteria.

Does that make sense? If not, I can post an attachment cuz this is really bugging me.

You cannot dynamically determine the field to set in a Set Field step. It must be explicit. However, you could test the field and set the appropriate one, such as

If [g_SearchCriteria = "field1"]

Set Field [field1, "data"]

Else

If [g_SearchCriteria = "field2"]

Set Field [field2, "data"]

...

End If

End If

You can get field data from a variable field name (with GetField), but there is no way to Set a variable field name (no SetField [ TextString , Calc ]).

You can use a series of If statements in your scripting to set the correct one:

If [ g_SearchCriteria = "Name" ]

Set Field [ Name ; g_SearchText ]

Else

If [ g_SearchCriteria = "Age" ]

Set Field [ Age ; g_SearchText ]

End If

...

Doh! You beat me to it Queue! d-oh.gif

  • Author

much thanks,to both of you

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.