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 field name and contents

Featured Replies

  • Newbies

I need to get a field name and its content and paste it into another field.

This will be part of a script and the fields will be different depending on which one was selected and what option from its pulldown menu. For example: If the category selected is SAWS and the item from the list is Circular Saw. I would like to capture "SAWS: Circular Saw" and paste this into a field called Tool

I've tried different calculations but I can't get it to do what I need. I am new to FM.

Thanks.

Hi Maria

attached is a sample of what i understood what you are trying to do.

tools.zip

Maria said:

I need to get a field name and its content and paste it into another field.

This will be part of a script and the fields will be different depending on which one was selected and what option from its pulldown menu. For example: If the category selected is SAWS and the item from the list is Circular Saw. I would like to capture "SAWS: Circular Saw" and paste this into a field called Tool

Maria ...

From your post it wasn't clear whether you want to capture the actual fieldname, or whether the user first makes a selection from a "category" field, and then makes a second selection from another field to choose a specific tool.

The demo submitted by oilman deals with the latter situation. My demo deals with capturing the actual fieldname and the specific tool selected.

I think ideally what you'd want to do, if you haven't done so already, is to have a tools file, with each tool coded by "type": Saws, Wrenches, Screwdrivers, etc. This way, when the user selects the type from the "Type" field, the next pop-up ("Tool") could be set to conditionally display only tools of that type. Then a simple concatenation calculation of: Type & ": " & Tool will produce the result you're looking for.

If you don't know how to do this, I'm sure peeps will jump in here to help you.

Good luck!

capture tool name.zip

Jim,

While your demo does pretty much what Maria asked for, I'm wondering if it would really be efficient to have the fields named that way.

As you know, it is of common practice to use some abbreviation to easily identify and sort these fields while in define fields Menu, and in the development process.

Therefore, I'd rather use your "realistic" suggestion that isn't that far from Lionel's suggestion too... wink.gif

Even if a bit tedious, we could also use an external file to store all "litteral" equivalents to "fieldnames", then the litteral definition using a

SetField[t_Tool, GetField(ExternalLitteral::"t_SAWS")&":"& " "&t_Type]

Just some thoughts.

Ugo ...

Totally correct.

Also, I try to look at it from the user's standpoint. They may not have the time (or the skills required) to re-structure their system in a more efficient manner. So I think it's sometimes best to give them a solution to their immediate problem (if it's not too unrealistic), while also offering alternative ways of thinking about the structure of their files, fields, etc.

I liked your suggestion about grabbing the "literal equivalent" of the field name. Thanks!

  • Author
  • Newbies

Thank you Jim and Oilman!

After looking at your files, it now seems so easy. I had tried to do it the way Jim's was scripted but it hadn't worked. Now I know why.

There are many different ways to essentially accomplish the same thing and as you say if I had structured the file more efficiently, some things wouldn't be necessary now.

Again, thanks.

Maria

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.