Newbies S Bohn Posted October 1, 2002 Newbies Posted October 1, 2002 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?
Garry Claridge Posted October 1, 2002 Posted October 1, 2002 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
Newbies S Bohn Posted October 2, 2002 Author Newbies Posted October 2, 2002 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.
Garry Claridge Posted October 2, 2002 Posted October 2, 2002 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
Recommended Posts
This topic is 8433 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now