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.

find records, duplicate, replace with value

Featured Replies

I am trying to find records, duplicate them, and replace with a specific value. I want to do this in a script. I run the find say for the number 7 , I might find ten records, I want to duplicate the 10, and replace the 7 with a 9 in all 10 duplicated records. I have tried using if and loop statements and I am not getting the desired results. Is there a -foreach- someplace.

like:

find 7

foreach found duplicate replace 7 with 9

Well here is a link to a recent thread on how to duplicate records.

http://fmforums.com/forum/showtopic.php?tid/193589

To change the field with a '9', add a set field step after the duplication within the loop.

Edited by Guest
Changed wording

  • Author

I am doing this

--

Go to first record

Duplicate

replace field contents

omit record

go to next record (exit after last)

...

--

It goes to the first record, does duplcate it but becomes 3rd record in this case because I only find two records. I cannot go to next record because I am at the last record after omit. I did use sort but it puts at the dupe at end.

Welcome to FM Forums, crowman.

In your script, the replace will affect the original as well as the duplicate, which is not what I think you intended. Try John's suggestion of Set Field. I.e., you'll be changing the value as you go along rather than mass-replacing.

Also read the discussion that he linked, I believe it will answer your questions about duplicating.

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.