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 multiple records into one field

Featured Replies

I am trying to get the first 40 records of the field "id" into a new field "id_numbers". I bulit a script to do this with loop and set field for id_numbers but I do not know how to script or define a calculation that would take the first 40 records and put it into a new field then grab the next 40 records and put it into the next id_numbers record. I have been trying the omit multiple and then delete all records but how to get the 40 records into the one record is beyond my FMP level. Any help would be greatly appreciated. Thank you

What do you mean, "get the 40 records into the one record" -- you mean you want the contents of ALL the fields into one field in one record? Or just the id_number? Or you want e.g. every record's field A into a single record's field A, every record's field B into a single record's field B, etc. ? Are we talking about just two groups of 40, or an indeterminite number? Are you doing this all in one file or multiple files? What's the ultimate goal?

  • Author

FItch,

Sorry for the vague question. First of all Im using one file. I only want to extract the "id" field from the first 40 records, then the id field from the next 40 records starting with record 41 looping until all the records have been gone through. The script holds the 40 records in a text field called id_numbers. The goal is to export all the id_numbers fields so that I can create a html doc that has static links to each of my records broken up by each id_numbers field. This would create individual files that have 40 links each to keep the file size below 20k. I hope this helps clear up my question.

Here is a method to put the id's of each group of 40 records into a field in the 40th record of each group. If there are fewer than 40 in the last group, the last record is set with the remainder:

First create a global field, gText.

In this Script, "P" means a paragraph symbol, or it could be a comma or whatever you want:

Loop

. Set Field ( gText, gText & "P" & ID )

. If ( PatternCount( gText, "P" ) > 39 )

. . Set Field ( id_numbers, Right( gText, Length( gText ) - 1 )

. . Set Field ( gText, "" )

. End If

. Go to record (Next, Exit after last)

End Loop

Set Field ( id_numbers, Right( gText, Length( gText ) - 1 )

Set Field ( gText, "" )

What's behind all this? What are you really trying to accomplish?

  • Author

What I am trying to accomplish is to export all the id_numbers fields so that I can create multiple html docs that have 40 static links one for each record.

  • 2 weeks later...
  • Author

Tom,

Got it to work. Thank you very much!!!!

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.