AnsweredAssumed Answered

Copying data to one field from multiple portal records

Question asked by ShirleyMB4 on Dec 5, 2011
Latest reply on May 14, 2012 by AllisonKerivan


Copying data to one field from multiple portal records


I duplicated the script steps found on the Support page post with the above title, but all that happens is that the first portal line only gets copied. Is there a problem in the posted page as it currently exists? I'm pasting it here for your easy reference. Thanks in advance for your help!


To copy data to one field from multiple portal records do the following:

In the master database add fields:
Combine (Text)
GobalCounter (Global) - Number
KeyCounter (Calculation) - Number - Count(Relation::KeyID) - KeyID used as the relationship link field

Use these script steps:

Set Field[GlobalCounter, "1"]
Set Field [Combine, ""]
Go to Portal Row [ select, First ]
Copy [ select, "Relation::Fieldname"]
Paste [ "Combine"]
Set Field [Combine, Combine & "¦"] 
Set Field[GlobalCounter, "GlobalCounter + 1"]
Go to Portal Row [ select, "GlobalCounter" ] - specify by field value
Exit Loop If [ "KeyCounter < GlobalCounter"]

What this script does:
First, the script "initializes" the GlobalCounter by setting it to 1, and then clears out the Combine field (so that it starts out empty). Then, starting at the first portal row, it loops through all the portal rows, copying the related Fieldname and pasting its value into the Combine field. Then, after each related value is copied into Combine, it appends a Carriage Return to the Combine field, so that the next related value appears on the next line. (This is optional). It finally exits when it has cycled through all the relatedrecords.