Where Does the System Get Related Number Count?

With the Concatenate expression, I have been able to populate the field of Account for a Location. The structure is one Bill To to many locations. So, I have put together the Bill To Account number with an added number. If the Bill To is 1001, I have concatenated the new location with 1001-01. I have done this manually just to test. (The Location field is not the table key) If I were able to extract the system count, I would be able to concatenate with the Bill To creating a sequence. Is there a way to extract that count?

If you are referring to the count of related records in the child table, those can be obtained from REV_REF column in the parent table. In the case shared by you, there will be a reverse reference LIST() type virtual column titled [Related Locations] that holds a list of key numbers of child table.

You could get the count by the expression COUNT([Related Locations]). However using this sequential serial number system is not a recommended practice in AppSheet, unless the app is a single-user app or the app will never be used simultaneously by more than one user for operations involving serial number logic. Please take a look at the following informative post by @Steve


Thanks for the reply. I think I did what you suggested. This is what I did:

The result in getting is all the child records are being added a 1. That would be find for the first one, not the subsequent ones. Any suggestions?

Could you update, where are you using this expression? Is this [Location] column in parent or child table?
Which is Parent Table and which is child table?

From the information shared so far, it sounds that your expression for that count part could be
COUNT([Bill-To].[Related Locations])


Thanks for the quick reply.
Location is the child to the Table Bill To.

And this is from the Bill To Parent Table

Okay, thank you. Then is the suggested expression working?

I did try it. It did not work.
I also tried the MAX expression, but gave an error.

It took some thinking but I did figure it out. Maybe it will help others this solution. (I feel proud of myself LOL)