October 1, 200223 yr 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?
October 1, 200223 yr 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
October 2, 200223 yr 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.
October 2, 200223 yr 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