How to count sessions per coach without new rows or hardcoded workflows?

I’m building a gym app in Glide.

I already have 3 main tables:

  • Users table — stores all users, including members and coaches, with their roles defined

  • Memberships table — defines the types of memberships (e.g. “10 Sessions”, “1 Month”)

  • Member Memberships table — each row represents a specific membership purchased by a member

During the time of a membership, members train with different coaches, depending on availability.


:bullseye: Goal:
I want to track how many sessions each coach has done with a specific member for each membership.

But I want to:

  • :cross_mark: Avoid creating a new row for every session (to save Glide row usage)

  • :cross_mark: Avoid using dropdowns to pick the coach

  • :cross_mark: Avoid manually updating workflows when a new coach is added


:brain: The idea:
Each time a coach presses the “Session Done” button, I want Glide to:

  • Automatically detect which coach pressed it (based on the signed-in user)

  • Increment a session counter tied to that coach in that specific membership row

Example desired structure:

Member Membership Coach James Sessions Coach Andrew Sessions
Jane 10 Pack 3 5

:red_question_mark:My question:
How can I dynamically track which coach pressed the button and increment their session count without hardcoding a separate IF/ELSE for each coach?

Is there a scalable way to do this within one row per membership, based on my existing table structure?

Just like I we discussed in your other thread, you can use the Set Column action to write the current date time as a special value. Likewise you also have access to the signed in user email as a special value, as well as any column from the user profile.

Thanks again for your support! I don’t store each training session as a separate row. Instead, I store each membership purchased by a member as a single row in the Member Memberships table. That row holds details like start date, end date, session limits, etc.

What I want to do is:

  • Have a column that stores the coach’s name every time a coach presses a “Training Done” button.

  • This way, the column will hold multiple coach names (e.g. “Ali,Ali,Veli,Veli,Ali”).

  • Then I want to calculate how many sessions each coach did for that membership based on the stored names.

Is there a way in Glide to:

  • Append names to a single column on each button press, and

  • Later count how many times each coach’s name appears in that column?

my problem is that set column value action just sets a specific value to that column. i need to add an other value to that column and have another column to count how many times each coach’s name is mentioned in the other column where we store them

What you could do is create a template column that takes the stores names, and adds a comma followed by the name from the user profile. For example, you can set up your template column like this and set up replacements for ‘Stored’ and ‘New’

Stored,New

Then change your Set Column action take the template value and write it to the Stored column. This will append the signed in user’s name each time the button is clicked.

As for the count, I guess it depends on how you want to present the results, but I’d maybe ask ChatGPT for javascript that takes the Stored value as input and returns a markdown table that you can display in a rich text component.

1 Like