FileMaker Forum

2answers

Looping though a list of values

I am looking for an example script that loops through a list of values?? I had found the FileMaker article here: http://help.filemaker.com/app/answers/detail/a_id/2403

I was advised to avoid using the copy and paste script steps. Instead, I should capture the data into a script variable and set the result back to a field via the Set Field script step.

The article shows a way to use a loop to run through the records in a portal, and send the useful data to another field.

While it works, it seems to be inefficient. It's the only script in my solution that displays an hour glass while running.

If the list of values were in a field, how could I loop through them?

I have already determined that I'll need to use the ValueCount function instead of the Count function. I was staring at the screen for 15 minutes wondering why the Count function always returned 1.

I attached an image of the data I am working with.

Also is it possible to produce a found set out of the List? I see now after testing some more that the portal has a way to refer to a "Related Record" it can get there. I guess the way I imagined it could be further automated is missing something (probably cause of lack of knowledge ) the something being a way to get to each record in the appropriate layout and do something. In my case I just want to check a condition (via a checkbox) and if true add them to a join table.

Chris Johnston

2answers

Help, my loop isn't working!

For some reason my loop isn't working correctly! Help! When the script runs, the script begins, but not with the first record (in the found set). Then, for some reason, it keeps looping. Why doesn't it stop looping and continue executing the script? Did I forget something?

Shanna Kurpe