Cognito-forms – Cognito Forms: Referencing a field in a repeating section

cognito-forms

I have a repeating section that collects contact information for ticket orders. In a calculated field outside of the repeating section (TicketOrders), I want to use the "Name" field of the first contact provided in the repeating section. The documentation describes "First()" will "Returns the first item in a repeating section or table." I've tried the calculation =Form.TicketOrders.First(Name.FirstAndLast), but get "No applicable aggregate method 'First' exists at character 18". Is there a bug here, or am I doing something wrong?

Best Answer

If you want to pull the value of a specific field from within a repeating section in Cognito Forms, I recommend using a combination of Where() in conjunction with Select(), as follows:

=Form.TicketOrders.Where(ItemNumber = 1).Select(Name.FirstAndLast)

This will allow you to pull data from specific items in the list.

https://www.cognitoforms.com/support/51/calculations/repeating-sectionstables