Jump 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.

Featured Replies

Does anybody have an example of a Script using a field of values and looping through it? I had found the FileMaker article here http://help.filemaker.com/app/answers/detail/a_id/2403 and added the good advice, that this is not currently the best way to do this, and other advice to not use copy and paste (a better way is to set variables and retrieve them was the advice of many knowledgeable people). In this article it show a way to use a loop to run through the records in a portal, and send the useful data to another field. It works but does not seem to be that efficient. One thing that makes me wonder about it, is this is the only script that show and hour glass in my solution.  So what if you had the list of values in field and wanted to check if some condition was true or anything else on the values. If these values are in a field how can you loop through and perform condition checks and such. I have already determined that you have to use ValueCount() instead of Count to count them, I was sitting 15 minutes wondering why Count was always 1. Pic shows type of result I am referring to.

 

http://pctechtv.com/show/listscript.png

 

 So what if you had the list of values in field and wanted to check if some condition was true or anything else on the values.

 

Not sure what exactly would you want to do as a result of the check. In general, the loop could go something like this:

Loop
 Set Variable [$i ; $i + 1]
 Exit Loop If [$i > ValueCount ( YourTable::YourField )]
 If [GetValue ( YourTable::YourField ; $i ) > 100]
  # do something here
 End If
End Loop
  • Author

That is a very helpful start. Thanks so much!

Why not attach a copy or mockup of your file.

 

If you need an example of the steps to do this, see this step by step instruction.

 

How to attach a file to your post

 

Lee

  • Author

I did a little more research and produced a better script, I think. I say better because it works, no hourglass but don’t know if more in line with best practices.

http://pctechtv.com/show/bpscript.png

It's not possible to assess a solution without understanding the problem it is designed to solve. Of that you have told us nothing and neither does your script. It looks like you are creating child records based on a list held in a field (or fields?) of the parent, but I cannot figure out what your tables are and what are the relationships between them.

 

One thing that stands out is that your loops have a Go to Layout[] step but you never leave that layout, so that seems like a redundant repetition.

 

 

---

BTW, "INFORMATION" is a really cryptic name for a table; all tables hold information. At least I haven't yet seen a table that contained socks or kitchen utensils...

Create an account or sign in to comment

Important Information

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

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.