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.

work around needed for repeating fields

Featured Replies

  • Newbies

I am trying to publish a HTML page with publication references for each staff member. I have managed to set up this using portals and all is good BUT! The data comes from another department's database using a relationship, and they are using repeating fields for multiple author names. It is not possible to change their database(believe me I have tried!), so I am trying to work around this. I understand repreating fields will not work in a portal, and I have become a bit stuck on this one.

Is it possible to set up a script in the database to bring all the repeating author names into one field, separated by commas, so it will show in the portal?

A few tools are available for reading from Repeating fields.

The 'GetRepetition(,)' function can be used in a 'SetField()' script-step to loop through a repeating field to concatenate text to another field. This can also be used in a 'Calculation' for the same effect.

The '[FMP-Repeating]' tag can be used with CDML for Custom Web Publishing applications.

All the best.

Garry

  • Author
  • Newbies

I am unable to get it working, is this the correct script that I should be using?

Enter browse mode

Go to Layout [Main]

Set field ["authormerge", "GetRepetition[publications::authors], 10]

I wasn't able to get it to work in a calculation field either.

Thanks again.

In the Calculated field you can use:

GetRepetition(myfield,1) & " , " & GetRepetition(myfield,2) ....

In a Script you should use a Global variable (g_CurrentRep) to track the repetition number; e.g.

Set Field["g_CurrentRep","1"]

Loop

Insert Calculated Result["mynewfield","GetRepetition(myfield,g_CurrentRep)"]

Exit Loop If["g_CurrentRep=5"]

Set Field["g_CurrentRep","g_CurrentRep + 1"]

Insert Text[" , "]

End Loop


I have assumed that the repeating field "myfield" has 5 repetitions. Or, you could test if the current repetition is empty.

Hope this helps.

Garry

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Account

Navigation

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.