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.

Using Set field with repeating fields.

Featured Replies

I have one field that has three repetition. I want to set repetition 3 with repetition 2 and the repetition 2 with 1.

Set Field ["field"-3. "GenRepetition,(field,2)"]

Set Field ["field"-2. "field"]

In my tests it will not work in 5.5 OS X or 9.x. Insert calculated result does not work either. Is this a bug???

Help. confused.gif

Yes, this might be some kind of bug, or at least for some reason FM does not do. The direct reference in a setfield to a getrepetition does NOT work when a repeated field must be set. But a workaround is to capture the getrepetion in a global, and then do the setfield. It's one step extra but it works.

(I encountered the same too).

Set Field [gTemporaryfield "GetRepetition,(field,2)"]

Set Field ["field"-3. "gTemporaryfield"]

Set Field ["field"-2. "field"]

Harryk

Hi Harry,

The method you're suggesting is in fact the work-around that FMI recommend in their Kbase article on this subject. But there is a better way.

A little while back the inimitable dj pointed out that you can use:

Set Field ["YourRepeatingField"-3, "GetRepetition(YourRepeatingField, 2) & "" "]

The little appended 'null' on the end apparently has the mysterious effect of distracting FM for just long enough for it to 'forget' that it has a bug with repetitions. wink.gifgrin.gif

Try it out - it works!!

It's still a workaround, maybe, but it sure beats decanting your data all around the place between globals and back (not to mention making the scripts easier to read and a *lot* shorter! smile.gif

>getrepetetetetetition 'bug'

Good tip! By the way, are there any issues you d

Hi Harry,

I could be 'funny' and say "I don't know"... wink.gif

But seriously, I appreciate the compliment, but knowledge is an ocean, and the human mind is a leaky cup. We're all learning, yet there's always much much more to know! smile.gif

  • 2 months later...

Poster: CobaltSky

Subject: Re: Using Set field with repeating fields.

Hi Harry,

The method you're suggesting is in fact the work-around that FMI recommend in their Kbase article on this subject. But there is a better way.

A little while back the inimitable dj pointed out that you can use:

Set Field ["YourRepeatingField"-3, "GetRepetition(YourRepeatingField, 2) & "" "]

It's a while back, that you gave me this answer Ray, I remembered it, and the occasion occurred to try it out, but with me, this does not work..

A brief summary of the problem: a setfield of a repeating field with another repeating field does not work, despite the add of the & "".

Of course there are workarounds (apart from the fact that I will tackle my problem another way, with portals), you can use a temporarily global as an 'in between'.

As you referred to the unimitable dj, having the solution to this tiny problem, have one of you perhaps any comments on this?

Thanks

Harryk

In order to make it works, yoy'll need to use proper sufix: "" for text, +0 for nums ect.

Dj

SetRepetition.fp5.zip

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.