FileMaker 14 Field Placeholders and Repeating Fields

Here is nice little discovery I made the other night. It shows how to label each cell in a repeating field when you have it as a single object. I might not be groundbreaking stuff, but I found it kinda cool, felt it was worth sharing. All it takes is a little pattern counting based on something we can predict (the naming of each cell in a repeating field), a case statement to resolve when it finds the first true value, and a LET Statement to make it look nice and clean

PLACE THE FOLLOWING SYNTAX INTO THE PLACEHOLDER CALCULATION BOX
 -----
 Let (
 [
 ~var = GetFieldName ( Self ) ;
/* Search for the "[" and "[#]" to detect the correct repetition */
 ~query = Case (
 PatternCount ( ~var ; "[") = 0 ; 1 ;
 PatternCount ( ~var ; "[2]") > 0 ; 2 ;
 PatternCount ( ~var ; "[3]") > 0 ; 3 ;
 PatternCount ( ~var ; "[4]") > 0 ; 4 ;
 PatternCount ( ~var ; "[5]") > 0 ; 5 ;
 PatternCount ( ~var ; "[6]") > 0 ; 6 ;
 PatternCount ( ~var ; "[7]") > 0 ; 7 ;
 PatternCount ( ~var ; "[8]") > 0 ; 8 ;
 PatternCount ( ~var ; "[9]") > 0 ; 9 ;
 "Value Not Assigned"
 );
 ~label = Case (
 ~query = 1 ; "Label1" ;
 ~query = 2 ; "Label2" ;
 ~query = 3 ; "Label3" ;
 ~query = 4 ; "Label4" ;
 ~query = 5 ; "Label5" ;
 ~query = 6 ; "Label6" ;
 ~query = 7 ; "Label7" ;
 ~query = 8 ; "Label8" ;
 ~query = 9 ; "Label9" ;
 ""
 );
 ~result = ~label
 ];
 ~result
 )
 -----

I have been using a lot of repeating fields lately to temporary collect data before I either store into the desired table, or use the values to do whatever. Hopefully this little tip helps you with your solutions.