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.

Setting value of a field to value of another field

Featured Replies

I know how to set the value of one field to another field, the trouble I'm having is making the script run through all the records and set the value of one field to another field.

Here's what I have for the script:

Go to Layout ("Layout 1")

Show All Records

If [Field 1="A"]

Set Field ["Field 2", "A"]

End If

What's the proper way to make it run through all the records and set the values of Field 1 to Field 2? Would a Loop Statement work? Not exactly sure how to setup the syntax.

Please help!!

Thanks

Ron

Show All

Go to Record(first)

Loop

If....

Set Field...

Go To record(next, exit after last)

End If

End Loop

** edit: do yourself a favor and make a backup copy of the file before running scripts that change a large number of records... just in case.

Just off the top of my head:

How about the replace spript step for field 2, using the calculation Case(field1="A"; "A"; field2). This will probably be much faster then a loop. Thus if the field2 will be populated with A if field 1 is A, but left to its original value (field2) if the condition is not met. Good luck.

PS I wish the Fm designers used additional words in the terms for the script and functions "replace" and "substitute". It would create less confusion.

  • Author

SBG2 - Thanks so much for the loop script, I tried it and it worked, but then I tried the Replace & CASE from Old Sneakers and that was a lot quicker.

Thanks to both of you for solving it...this will make things a lot easier!

P.S. I did make a backup copy to test this on. Thanks for the tip.

A few things to note ...

In vs. 6, Replace Contents requires the field be on a layout before it will work. It also will not provide an error message if the record is currently locked by a User in networked environment, so if this is a networked solution I'd use the Set Field instead.

Curious that, in vs. 7, is still indicates the field must be on the layout but tests prove otherwise.

LaRetta

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.