Get Index of Repeater
Hello everyone,
I’m working on a personal project: a Gym Management System. In this system, I need to create Workouts, and each workout is divided into multiple Divisions, with each division containing several Exercises. Here's the structure:
Workout
Division 1
Exercise 1
Exercise 2
Exercise 3
Division 2
Exercise 1
Exercise 2
Exercise 3
Division 3
Exercise 1
Exercise 2
Exercise 3
To implement this, I’m using a Repeater field for the divisions. Each division contains fields for its name and related exercises. What I want is for the Division name to be generated automatically based on its position in the list (e.g., "Division 1", "Division 2", etc.) as new divisions are added. Currently, I’ve set a default value for the name field, but it’s always assigning the same name (e.g., "Division 1") to all divisions, instead of dynamically updating based on the index. Does anyone have suggestions or best practices for implementing this? Ideally, I’d like the names to update automatically based on their index in the Repeater. Thanks in advance for your help!
Division 1
Exercise 1
Exercise 2
Exercise 3
Division 2
Exercise 1
Exercise 2
Exercise 3
Division 3
Exercise 1
Exercise 2
Exercise 3
To implement this, I’m using a Repeater field for the divisions. Each division contains fields for its name and related exercises. What I want is for the Division name to be generated automatically based on its position in the list (e.g., "Division 1", "Division 2", etc.) as new divisions are added. Currently, I’ve set a default value for the name field, but it’s always assigning the same name (e.g., "Division 1") to all divisions, instead of dynamically updating based on the index. Does anyone have suggestions or best practices for implementing this? Ideally, I’d like the names to update automatically based on their index in the Repeater. Thanks in advance for your help!
1 Reply
Using the $get('../') method inside the repeater works.