This is the legacy 4D documentation web site. Documentations are progressively being moved to developer.4d.com |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
4D v20 R7
DISTINCT ATTRIBUTE PATHS
|
DISTINCT ATTRIBUTE PATHS ( objectField ; pathArray ) | ||||||||
Parameter | Type | Description | ||||||
objectField | Field |
![]() |
Indexed object field | |||||
pathArray | Text array |
![]() |
Array to receive list of distinct paths | |||||
The DISTINCT ATTRIBUTE PATHS command returns the list of distinct paths found in the indexed object field you passed in objectField for the current selection of the table to which this field belongs.
In objectField, you must pass an Object type field that is indexed; otherwise, an error is returned.
After the call, the size of pathArray is equal to the number of distinct paths found in the selection. Paths to nested object attributes are returned using the standard dot notation, for example "company.address.number". Keep in mind that object attribute names are case-sensitive. The command does not change the current selection or the current record.
In pathArray, the list of distinct paths is returned in alphabetical (diacritic) order.
Notes:
Your database contains a [Customer]full_Data (indexed) object field with 15 records:
If you execute this code:
ARRAY TEXT(aTPaths;0)
ALL RECORDS([Customer])
DISTINCT ATTRIBUTE PATHS([Customer]full_Data;aTPaths)
The aTPaths array receives the following elements:
Element | Value |
1 | "age" |
2 | "Children" |
3 | "Children[]" |
4 | "Children[].age" |
5 | "Children[].Name" |
6 | "Children.length" |
7 | "client" |
8 | "FirstName" |
9 | "LastName" |
10 | "Sex" |
11 | "telephone" |
12 | "telephone[]" |
13 | "telephone.length" |
Note: "length" is a virtual property that is automatically available for all array type attributes. It provides the size of the array, i.e. the number of elements, and can be used in queries. For more information, please refer to the Using the .length virtual property paragraph.
Product: 4D
Theme: Arrays
Number:
1395
Created: 4D v16
4D Language Reference ( 4D v20 R7)