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.

?Change field definition on a repeating field

Featured Replies

Can anyone help? I need to change a field that was previous defined and used as a repeating field to a single text box. How can I do that and retain the information entered into the repeated field lines into the redefined field?

Thanks

First, I would add a text field (or use one that's not currently in use) to hold the data temporarily. I'll call it temptext. Go to a layout that contains the repeating field (which I'll call repeatingfield and make sure the tab order is set to cycle through all repetitions of the field consecutively.

Then you can use the following script:

Show All Records

Go to Record/Request/Page [First]

Loop

[color:"white"]__Go to Field [repeatingfield]

[color:"white"]__Loop

[color:"white"]____Set Field [ temptext, temptext & Status(CurrentFieldContents) & "

  • Author

Thanks for the quick reply. I actually kind of found my way there trying to use the GetRepetitions function with new field (one for each repetition) and then concatenating into one, but am struggling with my loop working.

I will try your script exactly as you've given it and see what comes up.

Thanks a bunch!

Just so you know, if you are setting a repetition in one field with the same repetition from another field, it is not necessary to use GetRepetition. FM assumes the repetitions are the same if you specify the Set Field one, unless you tell it otherwise. So Set Field ["repa"-5, repb] will set the fifth rep of repa with the fifth rep of repb. It's only if you require different reps that a GetRepetition is required, e.g. Set Field["repa"-5, GetRepetition(repb, 6) & ""]. The addition of & "" is required when using GetRepetition on text fields, due to a glitch.

Note also (just for fun) that Set Field ["repa"-1, GetRepetition(repb, 1) & ""] and Set Field ["repa"-1, repb] are both equal to Set Field [repa, repb].

  • Author

It only came up with the data from the first repeating line? Here's what I ran

Show All Records

Go to Record/Request/Page [First]

Loop

Go to Field [Production Description]

Set Field [Description, Description & Status(CurrentFieldContents) & "paragraph mark"]

Go to Next Field

Exit Loop If [not Status(CurrentFieldName) = Production Description]

End Loop

Go to Record/Request/Page [Next, Exit after last]

End loop

What did I miss? I did tab set as you instructed. Any ideas?

thanks

Did you make your text field large enough to view all data in it? If you click in it, you should see the first line followed by the invisible return and subsequent repetition data below it.

Whoops! Where does your second loop begin? I don't see it in your post.

  • Author

thought i posted this once already, but here's my reply cause I don't see it.

Thanks. Yes both of those are a OK. I just didn't type the other Loop in my reply; it is after Go to Field [Product Description].

Any other ideas? Thanks again!

Ah, you need quotes around Production Description in the Exit Loop If step. Otherwise you are testing whether the current field name matches the value in Production Description. Since it doesn't ever (I would assume), the loop exits after one iteration.

  • Author

Bingo! Thanks for muddling through it with me, it worked like a charm.

Have a great evening!

Jana said:

Can anyone help? I need to change a field that was previous defined and used as a repeating field to a single text box. How can I do that and retain the information entered into the repeated field lines into the redefined field?/quote]Note that after doing this, you are going to have a problem. Filemaker remembers the content of what was in the field. Let's say repetition 2 of some record contained "oz". No other record contain this value. Convert the field. In the "oz" record, do NOT put "oz" in the updated field. Find "oz". It will continue to show this fantom value in finds and in the field index.

Good point! You'll want to change your field back to the number of repetitions it contained previously and loop through all repetitions greater than the first, setting them to null.

Show All Records

Go to Record/Request/Page [First]

Loop

Go to Field [repfield]

Go to Next Field

Loop

Set Field [, ""]

Go to Next Field

Exit Loop If [not Status(CurrentFieldName) = "repfield"]

End Loop

Go to Record/Request/Page [Exit after last, Next]

End Loop

I haven't tested this yet, so BACK UP your file first.

Note that you don't specify a field in the Set Field step, only the calculation of "".

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.