Hi, I need to create a list of the contents of a field for all records in a found set. The List function by itself doesn’t do the job as it appears to capture only the first record. What else do I need to do?
Thanks
Hi, I need to create a list of the contents of a field for all records in a found set. The List function by itself doesn’t do the job as it appears to capture only the first record. What else do I need to do?
Thanks
To PeterDoern's excellent list, I'll add
For Item #3:
If the target field is in the table of the current context (i.e. not a related field), you might build your looping script around using the GetNthRecord function, rather than the more readily apparent choice of building it around the Go To Record (next) script step.
Also, if there is a huge number of records, you might check out this post, which discusses a recently discovered performance gain related to how one iteratively builds up a result in a $variable.
Also, I know that developers have built up modules to handle this sort of requirement, and I am sure these modules are good, too. Not having used them, I'll just mention that they exist, and maybe someone with some experience/insight concerning the modules will chime in. I don't think, however, that using a module is necessarily essential for this task -- just mentioning it for the sake of tossing out one more avenue to consider. I typically use any of the approaches from Peter's list (above).
HTH & Sincerely,
-steve
Somehow I'd mentally conflated the Replace Field Contents technique with the Insert Calculated Text technique; thanks for reminding me. We live in heady days for found-set-data-scraping!
Also, yes, GetNthRecord is probably a better answer than actually looping through the records... no need to worry about script triggers and such.
List works for related records.
The “list of” type summary field field will do what you need and you can copy the contents of the summary field into a text field or variable if you need the list for something that doesn’t work for a summary field—such as a multi-key in a relationship.