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.

Getting the Contents of one field into another

Featured Replies

Hello Board,

I have a table with a list of randomly generated alpha-numberic codes in it.

When hitting a button, I want a script to go to that table, to the first field, copy the contents of the field and then put it into the field of another table. There are additional steps but this is the first bit I'm having a problem with!

I've tried using the Get (ActiveFieldContents) by first using GoToField but that hasn't returned anything.

I've tried GoToField, SelectAll, Copy All, GoTo(target)Field, Paste, but that doesn't work either.

Should i use SetField or similar?

After it has got the number, i need to delete that record in that RandomNumberTable, do a NewRecord and then loop the script a pre-specified number of times, but I will work that out after this bit.

Thanks for your help.

In psuedocode...

Set Variable [ $alphanum; RandomNumberTable::alpha_number ]

Go To layout [ New table layout ]

New Record

Set Field [ NewTable::someField; $alphanum ]

....

....

...

  • Author

Thank you for putting this up.

I've spent a bit of time reading about the Set Variable and Set Field functions.

So, the Set Variable is just like a clipboard to store a bit of data on the fly? When does that variable get destroyed or lost?

My Script is:

Set Variable [$AlphaNum; Value:RandomNumbers::RandomAlpha]

Set Field [TestTable::UI Test Hole]

But i can't get any further than this. The last line should, by my thinking, be

Set Field [TestTable::UI Test Hole; $AlphaNum]

Although i get an error in the script builder saying it is expecting an operator or other at the front.

If my AlphaNum table has 10000 records, will the Set Variable just take the first number in the table?

Can you Copy/Paste a calculation field result? That's another way to do this job, if you can? Copy the field, paste it into another field?

Thanks!

Harry

When hitting a button, I want a script to go to that table, to the first field, copy the contents of the field and then put it into the field of another table.

To expand a bit on John's example:

Go to Layout [ RandomCodes ]

Go to Record [ ??? ]

Set Variable [ $code ; RandomCodes::Code ]

#

Go to Layout [ Original Layout ]

Set Field [ AnotherTable::SomeField ; $code ]

Note the change of context between "loading" the variable and "delivering" it to its destination. There is also an assumption here that the script starts at a layout of "AnotherTable" and that the current record in this table is the target record for this operation.

When does that variable get destroyed or lost?

A local $variable - at the end of the script. A global $$variable - at the end of the session (unless you set it to empty before that).

Can you Copy/Paste a calculation field result?

You can, but it's not good practice because it interferes with user's clipboard.

  • Author

That's really concise and has answered my questions, thank you so much! It's really clear to me how it works, so I'll start by implementing that.

Thank you again, Comment.

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.