Skip to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Loop through records without refresh on layout?

Featured Replies

I am trying to loop through a number of records to get all the data from one field into a single memory variable. However, as I loop through the records, they are refreshing on the layout.

More details...

Each record contains information about a stock. One piece of the data is a stock symbol. I need to get all of them into a comma separated variable.

I created a script that does this, but as it loops through the records, the layout is refreshing and it looks a little strange, to say the least. How can I keep the screen from refreshing?

Try a new layout - with out any fields on it.

  • Author

I assume I am approaching this correctly? I didn't think there was any way to do this with a calculation field set as a global field?

I did find a way to get back to the record that I started on by using the Get(recordID).

Use the Freeze Window script step before the loop starts.

Also, it will be much faster if you change the view type to form instead of list. Your script can set it back to list when done.

I assume I am approaching this correctly? I didn't think there was any way to do this with a calculation field set as a global field?

I did find a way to get back to the record that I started on by using the Get(recordID).

How does that work? Do you mean get( recordNumber)?

I am trying to loop through a number of records to get all the data from one field into a single memory variable.

Hi

you do not need a loop in your script if you'll set your variable with something like this:

Set Variable [ $yourVar ; Value: CommaSeparatedFound ( YourField ) ]

where CommaSeparatedFound ( text ) is a Custom Function:


GetNthRecord ( text ; Let ( $var = $var + 1 ; $var ) ) &

Case(

$var < Get ( FoundCount ) ; "," & CommaSeparatedFound ( text ) ;

Let ( $var = "" ; "" )

)

In such way you'll not have to worry where to go back, neither the refresh issue.

You could even use the same Custom Function in a calculation field ( instead of setting a variable ), but remember to make it UNSTORED.

GetNth is a really handy function for small record sets. But it has quite poor performance. For instance, It is about 6X faster to use a standard looping script.

Example result using function above on 10,000 records: 13 seconds for CF, 2 seconds for looping script. Applescript: 2 seconds for 50,000 records.

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.