({{, (RefLink[SquareRepeatingElement, paclet:ref/SquareRepeatingElement])[spec] 
represents a square array of elements of type spec in an interpreter, API or form specification.}, {, (RefLink[SquareRepeatingElement, paclet:ref/SquareRepeatingElement])[spec,max]
represents a square array of elements of maximum size max×max.}, {, (RefLink[SquareRepeatingElement, paclet:ref/SquareRepeatingElement])[spec,{min,max}]
represents a square array of elements of size between min and max.}})

OpenersNotesSection(Spacer1)Details

In the context of (RefLink[Interpreter, paclet:ref/Interpreter]), spec can be any specification used for (RefLink[Interpreter, paclet:ref/Interpreter]), including (RefLink[CompoundElement, paclet:ref/CompoundElement]) or (RefLink[RepeatingElement, paclet:ref/RepeatingElement]).

In the context of (RefLink[FormObject, paclet:ref/FormObject]) and (RefLink[FormFunction, paclet:ref/FormFunction]), spec can be any specification used for forms, including the full association.

OpenersPrimaryExamplesSection(Spacer1)Examples  (9)

OpenersExampleSection0(Spacer1)Basic Examples  (3)

Use (RefLink[SquareRepeatingElement, paclet:ref/SquareRepeatingElement]) to interpret a square matrix of data:

Interpreter[SquareRepeatingElement["Number"]][{{"1.1", "3.2"},{ "32", "22.2"}}]

(RefLink[SquareRepeatingElement, paclet:ref/SquareRepeatingElement]) fails on data that is not square:

Interpreter[SquareRepeatingElement["Number"]][{{"1", "2.5", "3.2"},{"11", "15", "12.2"}}]

Use it in an (RefLink[APIFunction, paclet:ref/APIFunction]) to collect complex data:

api =CloudDeploy @ APIFunction[
"data"->SquareRepeatingElement["Integer"],
Det[#data]&,
AllowedCloudParameterExtensions->{"json"}
]

URLExecute[api, {"data__json" -> "[[1, 2], [3, 4]]"}]

OpenersExampleSection1(Spacer1)Scope  (2)

The second argument is used to limit the size of the input:

Interpreter[SquareRepeatingElement["Integer", 2]][{{"1","2","3"},{"11","22","33"},{"111","222","333"}}]

Interpreter[SquareRepeatingElement["Integer", 2]][{{"1", "2"},{"3", "4"}}]

Limit the minimum size of the array:

Interpreter[SquareRepeatingElement["Integer", {2, 100}]][{{"1"}}]

Interpreter[SquareRepeatingElement["Integer", {2, 100}]][{{"1","2"},{"3","4"}}]

OpenersExampleSection3(Spacer1)Properties & Relations  (3)

(RefLink[SquareRepeatingElement, paclet:ref/SquareRepeatingElement]) can be used in conjunction with any interpreter specification:

Interpreter[SquareRepeatingElement["Integer"|"Country"]][{{"15", "burkina faso"}, {"chad", "5"}}]

Including (RefLink[RepeatingElement, paclet:ref/RepeatingElement]):

Interpreter[SquareRepeatingElement[RepeatingElement["Number"]]][{{{"1","2","3"},{"1"}},{{"5", "6"}, {"7"}}}]

And (RefLink[CompoundElement, paclet:ref/CompoundElement]):

Interpreter[SquareRepeatingElement[CompoundElement[<|"country" -> "Country", "city" -> "City"|>]]][{{<|"country" -> "argentina", "city" -> "dubai"|>, <|"city" -> "bangalore", "country" -> "usa"|>},{<|"country" -> "angola", "city" -> "lahore"|>, <|"city" -> "bangkok", "country" -> "canada"|>}}]

OpenersExampleSection4(Spacer1)Possible Issues  (1)

Constructs like (RefLink[FormFunction, paclet:ref/FormFunction]) and (RefLink[FormPage, paclet:ref/FormPage]) do not show a special interface for (RefLink[SquareRepeatingElement, paclet:ref/SquareRepeatingElement]):

CloudDeploy[
	FormFunction["data" -> SquareRepeatingElement["Integer"],
	Det[#data]&
]]

Use JSON to fill in the fields:

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {(RefLink[RectangularRepeatingElement, paclet:ref/RectangularRepeatingElement])  ▪  (RefLink[RepeatingElement, paclet:ref/RepeatingElement])  ▪  (RefLink[Interpreter, paclet:ref/Interpreter])  ▪  (RefLink[SquareMatrixQ, paclet:ref/SquareMatrixQ])}})}})

({{DocumentationFooterIconsRelatedGuide.png, ({{Related Guides}, {▪(RefLinkPlain[Setting Up Input Interpreters, paclet:guide/InterpretingStrings])}})}})