Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 4940 days old. Please don't post here. Open a new topic instead.

Recommended Posts

  • Newbies
Posted

I am trying to figure out a way to create a script to loop through specific fields, but i can't use variables in field names. I have a table that contains inventory information for a walk-in cooler, each footprint in the cooler has fields for type of product and qty. They are all named the same except for the number after the end of each field name ex prod1, prod2, prod3, qty1, qty2, qty3 etc etc. I was writing a script to populate another table in the database with sums of everything in the walkin (ie 15 of this type, 30 of this type, etc) I thought i could set up something like a for loop where i have an integer that increments at the end of each loop iteration so i could use the value of the integer in the variable (ex. prod$i, qty$i.) Filemaker will not let me do this however because it wants a specific field name. I thought about using the "go to next field" function but each walkin object has multiple fields, and I'm not sure how to tell which field I am on or how to pass the value of the "current field" to a local variable. This walk-in is huge and it would take me forever to do each individual field. Any ideas on how i can loop through these fields to pull the information i want?

Posted

I am trying to figure out a way to create a script to loop through specific fields, but i can't use variables in field names. I have a table that contains inventory information for a walk-in cooler, each footprint in the cooler has fields for type of product and qty. They are all named the same except for the number after the end of each field name ex prod1, prod2, prod3, qty1, qty2, qty3 etc etc.

You are trying to solve the wrong problem.

Field names like that are almost always always a sign that the basic data structure needs to be normalized.

Because - no surprise here- it presents reporting problems, and many other problems.

It will help to start with a more complete description of what this is all about.

This topic is 4940 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

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