AnsweredAssumed Answered

Call a field name using the contents of another field

Question asked by afp on Nov 27, 2017
Latest reply on Nov 27, 2017 by bigtom

I'm hosting an obstacle course with 6 heats. Each heat has a different set of 6 obstacles.


In my main table, each record (a competitor) has a "Heat" value of 1-6.

In a related table ("Obstacles") there are values already stored for "Heat1Obstacle1"all the way to "Heat6Obstacle6" ("Tunnel", "Cargo Net" etc.)


I would like to create a competitor page that shows what obstacle they are facing - using the content of field "Heat" to determine which obstacle should be displayed.


Is there any way to use the Heat value as a variable to call the field? Or automatically set a new field?


ie. if Heat=4 , display the "Heat4ObstacleX".


I have been writing a script with If, Set Field and Else If statements but it seems inefficent...

e.g. for obstacle 1

          IF MainTable::Heat = "1"

          Set Field CompetitorObstacle1 ; Obstacles:Heat1Obstacle1


I'm using FileMaker Pro 15. Many thanks - this seems like a really basic question but I have searched a lot through the help files and this forum and come up stumps.