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.

creating records using the a number in a field

Featured Replies

hi everyone,

i was wondering if there was a way to create/duplicate lets say 5 records using a calculation or script. what i want is to ask how many records you want to create and what ever number is in that field it will create that many records.

thanks

Peter

One way is when you begin a LOOP, set the LOOPCOUNT field match the amount of times you want the Loop to run, and then, in the loop script itself, have it deduct 1 from the LOOPCOUNT field each time it loops.

Finally, as the first step of the Loop, place a conditional that Exits the Loop script if LOOPCOUNT is zero.

  • Author

ok that sounds good, but the problem that i keep having is that the loopcount will be a number that the user would input.

so here is what i have:

loop

exit loop if["loopcount=0"]

exit loop

all i need it to do is make a duplicate records (duplicate the number of times indicated in the loopcount) of the current one.

i tried using some of the status functions.

any help would would be greatly appreciated.

peter

I used the following script to create blank records.

New Record/Request

Loop

Enter Browse Mode

Perform Find[Restore]

Exit Loop If["Status(CurrentFoundCount)=Number of Records"]

New Record/Request

End Loop

Set up the find to look for empty values in any field and store this find in your script. Create a global number field to use for the number of records you want to create. I named it "Number of Records". You could modify this to create duplicate records by using the Duplicate Record/Request step instead of New Record/Request. You would need to script the find to look for a value that only the original record and the duplicates would would have.

Enter Find Mode

Insert Calculated Result["YourField,Result"]

Perform Find

Hope this helps

ok that sounds good, but the problem that i keep having is that the loopcount will be a number that the user would input.

That's not a problem. They can enter any number they want, and the script will follow from it.

If you're worried about the LOOPCOUNT field getting in the way, just make it be an extra, temporary field, whose sole purpose is to specify how often the Loop will run when you trigger the script.

You can make it a Global field, but on a network that would just get in the way. I recommend using a straight number field.

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.