This chains are for counting chapters in an epub book and saving the number into a custom column.
For this chain to work you will need to have the Editor Chains plugin installed as well.
Editor Chains has an action called "Tag Actions" which allow the user to use criteria to locate tags. So for example, a user can use to search for all h1,h2,h3 tags with a class called "toc", and then count these tags, after which "Action Chains" can update a custom column with the count. Attached below is the chain that implement this solution (I left out specifying a class name and only specified tag names, you can add yourself with whatever criteria you wish).
Using this chain, the user has the opportunity to exclude or include tags based on their text (regex), so can only add tag the have the names chapter of part, or the tag that end or start with digit, and so on.
Note that you will have to configure the chain to choose the right column name you want to update.