The Related Records field in Kintone is a useful field that lists other records that match a given condition. However, the Related Records field does not state how many records it is listing - which may be difficult to count manually when there are many records listed.
This sample code does the counting for you, and displays the number in a Blank Space field of your App.
As shown in the image below, each record will display a different number for the total number of related records.
Refer to the Tutorial page, on how to add scripts to your app.
This sample will only display the number - it will not store and save the total number in a field.
As of an update on December 13, 2018, this sample does take into account the "filter" option of the Related Records field.