@celigo/api-specs 0.2.29 → 0.2.30

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/ai-agent.yml CHANGED
@@ -2119,9 +2119,11 @@ components:
2119
2119
  This field supports THREE DISTINCT PATTERNS that are easily distinguished:
2120
2120
 
2121
2121
  **1. json Path Syntax**
2122
- - MUST start with '$.' prefix
2122
+ - MUST start with '$' — the record root. An object record is addressed as
2123
+ '$.field'; a grouped (array) record as '$[0].field' / '$[*].field'
2123
2124
  - Used for precisely targeting data in structured JSON objects
2124
- - Examples: '$.customer.firstName', '$.items[0].price', '$.addresses[*].street'
2125
+ - Examples: '$.customer.firstName', '$.items[0].price', '$.addresses[*].street',
2126
+ '$[*].Tax' (every row of a grouped record)
2125
2127
  - Wildcards like [*] extract multiple values/objects
2126
2128
 
2127
2129
  ```json
@@ -2132,7 +2134,8 @@ components:
2132
2134
  - Contains '{{' and '}}' pattern
2133
2135
  - Evaluated by the AFE 2.0 handlebars template engine
2134
2136
  - Can include logic, formatting, and computation
2135
- - Access input record fields with {{record.fieldName}} notation
2137
+ - Access input record fields with {{record.fieldName}} notation; a grouped
2138
+ (array) record binds as `rows` instead — {{rows.0.fieldName}} / {{#each rows}}
2136
2139
  - Examples: "{{record.firstName}} {{record.lastName}}", "{{#if record.isActive}}Active{{else}}Inactive{{/if}}"
2137
2140
  - Valid on `object`, `objectarray`, and primitive-array dataTypes as
2138
2141
  well as scalars — the rendered template output must parse into the
@@ -2143,7 +2146,7 @@ components:
2143
2146
  ```
2144
2147
 
2145
2148
  **3. Hard-Coded Value (literal string)**
2146
- - Does NOT start with '$.'
2149
+ - Does NOT start with '$'
2147
2150
  - Does NOT contain handlebars '{{' syntax
2148
2151
  - System treats it as a literal string value
2149
2152
  - VERY COMMON for setting static/constant values
@@ -2165,10 +2168,38 @@ components:
2165
2168
  - The system maintains this context even in deeply nested mappings
2166
2169
  - For object mappings without child mappings, extract should return a complete object
2167
2170
  - When both extract and mappings are defined for objects, extract is applied first
2171
+ - The root is the record as it arrives: an object record roots at `$.field`; a
2172
+ grouped record (an array of rows — grouped exports, file key columns, NetSuite
2173
+ grouped saved searches) roots at the array, so its rows are addressed as
2174
+ `$[0].field` (one row) or `$[*].field` (every row). A root that contradicts the
2175
+ record's shape resolves to nothing without an error.
2168
2176
 
2169
2177
  For most simple field-to-field mappings, prefer JSON path syntax for its clarity and performance.
2170
2178
  For hard-coded values, simply use the literal string as the extract value.
2171
2179
  x-celigo-ai-guidance:
2180
+ - |-
2181
+ ## GROUPED (ARRAY) RECORDS
2182
+ Decide the JSONPath root from the record's shape before writing
2183
+ any extract. When the record is an array of rows, `$.field`,
2184
+ `$.properties.field` and `$.rows[*].field` all resolve to
2185
+ nothing — the processor still reports success and the request
2186
+ body ships as `{}`. Address rows as `$[0].field` (that row's
2187
+ value, typed) or `$[*].field` (every row: joined with commas
2188
+ into a `string` destination; rejected with
2189
+ `incompatible_destination_conversion` into a `number`
2190
+ destination). Column labels with spaces work as
2191
+ `$[*][Order Number]`, `$[*].[Order Number]`, or
2192
+ `$[*]['Order Number']`. For one destination element per row
2193
+ the two array kinds take different helper forms: a primitive
2194
+ array (`stringarray` / `numberarray`) uses `buildArrayHelper:
2195
+ [{"extract": "$[*].field"}]`; an `objectarray` uses
2196
+ `buildArrayHelper: [{"extract": "$[*]", "mappings": [...]}]`
2197
+ with the children addressing the row relatively (`$.field`,
2198
+ `{{rows.field}}`). An `extract` placed directly on the
2199
+ array-typed field yields nothing. Handlebars
2200
+ extracts bind the array record as `rows` (`{{rows.0.field}}`),
2201
+ an object record as `record`. The reverse holds too: `$[*]` on
2202
+ an object record iterates the object's values, not rows.
2172
2203
  - |-
2173
2204
  ## SIZE LIMIT
2174
2205
  The platform's import save validator caps this field at **1024
@@ -2426,7 +2457,11 @@ components:
2426
2457
  (`$.items[*]`), `"$"` (the record root), or omission — a
2427
2458
  constructed entry (child `mappings` with the extract omitted or
2428
2459
  `"$"`; the two spellings are equivalent) contributes exactly one
2429
- element, and entries append in order. Indexed or comma-joined
2460
+ element, and entries append in order. On a grouped (array)
2461
+ record the record itself is the array to iterate: `"$[*]"`
2462
+ yields one `objectarray` element per row (children address the
2463
+ row as `$.field`), and `"$[*].field"` yields one primitive-array
2464
+ value per row. Indexed or comma-joined
2430
2465
  entry extracts (`"$[0]"`, `"$[0],$[0]"`) are not valid: the
2431
2466
  processor renders the entire destination array as null with no
2432
2467
  validation error. To emit a fixed number of static elements, add
@@ -2447,7 +2482,9 @@ components:
2447
2482
 
2448
2483
  **For Simple Arrays (stringarray, numberarray, booleanarray)**
2449
2484
  - Only the 'extract' field is used to pull values
2450
- - JSON path with wildcards (e.g., $.items[*].name) returns multiple values
2485
+ - JSON path with wildcards (e.g., $.items[*].name) returns multiple values;
2486
+ on a grouped (array) record the record itself is the array, so the
2487
+ path roots at it ($[*].name — one value per row)
2451
2488
  - Each result is converted to the appropriate primitive type
2452
2489
  ```json
2453
2490
  {
@@ -2549,11 +2586,13 @@ components:
2549
2586
  - When both extract and mappings are provided, the system creates special composite objects
2550
2587
  that maintain hierarchical context during processing
2551
2588
  - This enables accessing both the current array element AND its parent context
2552
- - An ITERATING entry's extract MUST use JSON path syntax starting with '$.'
2553
- (e.g. '$.items[*]'). A CONSTRUCTED entry (child mappings building one element)
2554
- instead omits extract or sets it to exactly "$" — never rewrite "$" into a
2555
- '$.'-prefixed, indexed, or comma-joined form ('$[0]', '$[0],$[0]'): those render
2556
- the entire destination array as null without raising a validation error
2589
+ - An ITERATING entry's extract MUST be a JSON path that iterates an array:
2590
+ '$.items[*]' when the array is a field of an object record, or '$[*]'
2591
+ (objectarray) / '$[*].field' (primitive arrays) when the record itself is a
2592
+ grouped array of rows. A CONSTRUCTED entry (child mappings building one
2593
+ element) instead omits extract or sets it to exactly "$" — never rewrite "$"
2594
+ into an indexed or comma-joined form ('$[0]', '$[0],$[0]'): those render the
2595
+ entire destination array as null without raising a validation error
2557
2596
  - Each array helper entry acts independently, potentially adding multiple elements
2558
2597
 
2559
2598
  The buildArrayHelper is the most complex part of the mappings system - always analyze the
@@ -2967,9 +3006,11 @@ components:
2967
3006
  This field supports THREE DISTINCT PATTERNS that are easily distinguished:
2968
3007
 
2969
3008
  **1. json Path Syntax**
2970
- - MUST start with '$.' prefix
3009
+ - MUST start with '$' — the record root. An object record is addressed as
3010
+ '$.field'; a grouped (array) record as '$[0].field' / '$[*].field'
2971
3011
  - Used for precisely targeting data in structured JSON objects
2972
- - Examples: '$.customer.firstName', '$.items[0].price', '$.addresses[*].street'
3012
+ - Examples: '$.customer.firstName', '$.items[0].price', '$.addresses[*].street',
3013
+ '$[*].Tax' (every row of a grouped record)
2973
3014
  - Wildcards like [*] extract multiple values/objects
2974
3015
 
2975
3016
  ```json
@@ -2980,7 +3021,8 @@ components:
2980
3021
  - Contains '{{' and '}}' pattern
2981
3022
  - Evaluated by the AFE 2.0 handlebars template engine
2982
3023
  - Can include logic, formatting, and computation
2983
- - Access input record fields with {{record.fieldName}} notation
3024
+ - Access input record fields with {{record.fieldName}} notation; a grouped
3025
+ (array) record binds as `rows` instead — {{rows.0.fieldName}} / {{#each rows}}
2984
3026
  - Examples: "{{record.firstName}} {{record.lastName}}", "{{#if record.isActive}}Active{{else}}Inactive{{/if}}"
2985
3027
  - Valid on `object`, `objectarray`, and primitive-array dataTypes as
2986
3028
  well as scalars — the rendered template output must parse into the
@@ -2991,7 +3033,7 @@ components:
2991
3033
  ```
2992
3034
 
2993
3035
  **3. Hard-Coded Value (literal string)**
2994
- - Does NOT start with '$.'
3036
+ - Does NOT start with '$'
2995
3037
  - Does NOT contain handlebars '{{' syntax
2996
3038
  - System treats it as a literal string value
2997
3039
  - VERY COMMON for setting static/constant values
@@ -3013,10 +3055,38 @@ components:
3013
3055
  - The system maintains this context even in deeply nested mappings
3014
3056
  - For object mappings without child mappings, extract should return a complete object
3015
3057
  - When both extract and mappings are defined for objects, extract is applied first
3058
+ - The root is the record as it arrives: an object record roots at `$.field`; a
3059
+ grouped record (an array of rows — grouped exports, file key columns, NetSuite
3060
+ grouped saved searches) roots at the array, so its rows are addressed as
3061
+ `$[0].field` (one row) or `$[*].field` (every row). A root that contradicts the
3062
+ record's shape resolves to nothing without an error.
3016
3063
 
3017
3064
  For most simple field-to-field mappings, prefer JSON path syntax for its clarity and performance.
3018
3065
  For hard-coded values, simply use the literal string as the extract value.
3019
3066
  x-celigo-ai-guidance:
3067
+ - |-
3068
+ ## GROUPED (ARRAY) RECORDS
3069
+ Decide the JSONPath root from the record's shape before writing
3070
+ any extract. When the record is an array of rows, `$.field`,
3071
+ `$.properties.field` and `$.rows[*].field` all resolve to
3072
+ nothing — the processor still reports success and the request
3073
+ body ships as `{}`. Address rows as `$[0].field` (that row's
3074
+ value, typed) or `$[*].field` (every row: joined with commas
3075
+ into a `string` destination; rejected with
3076
+ `incompatible_destination_conversion` into a `number`
3077
+ destination). Column labels with spaces work as
3078
+ `$[*][Order Number]`, `$[*].[Order Number]`, or
3079
+ `$[*]['Order Number']`. For one destination element per row
3080
+ the two array kinds take different helper forms: a primitive
3081
+ array (`stringarray` / `numberarray`) uses `buildArrayHelper:
3082
+ [{"extract": "$[*].field"}]`; an `objectarray` uses
3083
+ `buildArrayHelper: [{"extract": "$[*]", "mappings": [...]}]`
3084
+ with the children addressing the row relatively (`$.field`,
3085
+ `{{rows.field}}`). An `extract` placed directly on the
3086
+ array-typed field yields nothing. Handlebars
3087
+ extracts bind the array record as `rows` (`{{rows.0.field}}`),
3088
+ an object record as `record`. The reverse holds too: `$[*]` on
3089
+ an object record iterates the object's values, not rows.
3020
3090
  - |-
3021
3091
  ## SIZE LIMIT
3022
3092
  The platform's import save validator caps this field at **1024
@@ -3274,7 +3344,11 @@ components:
3274
3344
  (`$.items[*]`), `"$"` (the record root), or omission — a
3275
3345
  constructed entry (child `mappings` with the extract omitted or
3276
3346
  `"$"`; the two spellings are equivalent) contributes exactly one
3277
- element, and entries append in order. Indexed or comma-joined
3347
+ element, and entries append in order. On a grouped (array)
3348
+ record the record itself is the array to iterate: `"$[*]"`
3349
+ yields one `objectarray` element per row (children address the
3350
+ row as `$.field`), and `"$[*].field"` yields one primitive-array
3351
+ value per row. Indexed or comma-joined
3278
3352
  entry extracts (`"$[0]"`, `"$[0],$[0]"`) are not valid: the
3279
3353
  processor renders the entire destination array as null with no
3280
3354
  validation error. To emit a fixed number of static elements, add
@@ -3295,7 +3369,9 @@ components:
3295
3369
 
3296
3370
  **For Simple Arrays (stringarray, numberarray, booleanarray)**
3297
3371
  - Only the 'extract' field is used to pull values
3298
- - JSON path with wildcards (e.g., $.items[*].name) returns multiple values
3372
+ - JSON path with wildcards (e.g., $.items[*].name) returns multiple values;
3373
+ on a grouped (array) record the record itself is the array, so the
3374
+ path roots at it ($[*].name — one value per row)
3299
3375
  - Each result is converted to the appropriate primitive type
3300
3376
  ```json
3301
3377
  {
@@ -3397,11 +3473,13 @@ components:
3397
3473
  - When both extract and mappings are provided, the system creates special composite objects
3398
3474
  that maintain hierarchical context during processing
3399
3475
  - This enables accessing both the current array element AND its parent context
3400
- - An ITERATING entry's extract MUST use JSON path syntax starting with '$.'
3401
- (e.g. '$.items[*]'). A CONSTRUCTED entry (child mappings building one element)
3402
- instead omits extract or sets it to exactly "$" — never rewrite "$" into a
3403
- '$.'-prefixed, indexed, or comma-joined form ('$[0]', '$[0],$[0]'): those render
3404
- the entire destination array as null without raising a validation error
3476
+ - An ITERATING entry's extract MUST be a JSON path that iterates an array:
3477
+ '$.items[*]' when the array is a field of an object record, or '$[*]'
3478
+ (objectarray) / '$[*].field' (primitive arrays) when the record itself is a
3479
+ grouped array of rows. A CONSTRUCTED entry (child mappings building one
3480
+ element) instead omits extract or sets it to exactly "$" — never rewrite "$"
3481
+ into an indexed or comma-joined form ('$[0]', '$[0],$[0]'): those render the
3482
+ entire destination array as null without raising a validation error
3405
3483
  - Each array helper entry acts independently, potentially adding multiple elements
3406
3484
 
3407
3485
  The buildArrayHelper is the most complex part of the mappings system - always analyze the
@@ -4689,6 +4767,16 @@ components:
4689
4767
  x-enumDescriptions:
4690
4768
  create: Builds entirely new output records from inputs, ignoring unmapped fields.
4691
4769
  modify: Makes targeted edits to existing records, preserving unmapped fields.
4770
+ x-celigo-ai-guidance:
4771
+ - |-
4772
+ On a grouped record (the export groups rows, so the record is an
4773
+ array) only `create` can author output — build it from the rows with
4774
+ `$[0].field`, `$[*].field`, or a `buildArrayHelper` over `$[*]`.
4775
+ `modify` has no object to overlay onto an array: the record passes
4776
+ through untouched and the processor reports success. Either mode
4777
+ reshapes the inside of one record; neither changes how many records
4778
+ the page carries (that is the export's `preSavePage` hook) or whether
4779
+ the export groups at all (that is its grouping setting).
4692
4780
  examples:
4693
4781
  - create
4694
4782
  - modify
@@ -607,9 +607,11 @@ components:
607
607
  This field supports THREE DISTINCT PATTERNS that are easily distinguished:
608
608
 
609
609
  **1. json Path Syntax**
610
- - MUST start with '$.' prefix
610
+ - MUST start with '$' — the record root. An object record is addressed as
611
+ '$.field'; a grouped (array) record as '$[0].field' / '$[*].field'
611
612
  - Used for precisely targeting data in structured JSON objects
612
- - Examples: '$.customer.firstName', '$.items[0].price', '$.addresses[*].street'
613
+ - Examples: '$.customer.firstName', '$.items[0].price', '$.addresses[*].street',
614
+ '$[*].Tax' (every row of a grouped record)
613
615
  - Wildcards like [*] extract multiple values/objects
614
616
 
615
617
  ```json
@@ -620,7 +622,8 @@ components:
620
622
  - Contains '{{' and '}}' pattern
621
623
  - Evaluated by the AFE 2.0 handlebars template engine
622
624
  - Can include logic, formatting, and computation
623
- - Access input record fields with {{record.fieldName}} notation
625
+ - Access input record fields with {{record.fieldName}} notation; a grouped
626
+ (array) record binds as `rows` instead — {{rows.0.fieldName}} / {{#each rows}}
624
627
  - Examples: "{{record.firstName}} {{record.lastName}}", "{{#if record.isActive}}Active{{else}}Inactive{{/if}}"
625
628
  - Valid on `object`, `objectarray`, and primitive-array dataTypes as
626
629
  well as scalars — the rendered template output must parse into the
@@ -631,7 +634,7 @@ components:
631
634
  ```
632
635
 
633
636
  **3. Hard-Coded Value (literal string)**
634
- - Does NOT start with '$.'
637
+ - Does NOT start with '$'
635
638
  - Does NOT contain handlebars '{{' syntax
636
639
  - System treats it as a literal string value
637
640
  - VERY COMMON for setting static/constant values
@@ -653,10 +656,38 @@ components:
653
656
  - The system maintains this context even in deeply nested mappings
654
657
  - For object mappings without child mappings, extract should return a complete object
655
658
  - When both extract and mappings are defined for objects, extract is applied first
659
+ - The root is the record as it arrives: an object record roots at `$.field`; a
660
+ grouped record (an array of rows — grouped exports, file key columns, NetSuite
661
+ grouped saved searches) roots at the array, so its rows are addressed as
662
+ `$[0].field` (one row) or `$[*].field` (every row). A root that contradicts the
663
+ record's shape resolves to nothing without an error.
656
664
 
657
665
  For most simple field-to-field mappings, prefer JSON path syntax for its clarity and performance.
658
666
  For hard-coded values, simply use the literal string as the extract value.
659
667
  x-celigo-ai-guidance:
668
+ - |-
669
+ ## GROUPED (ARRAY) RECORDS
670
+ Decide the JSONPath root from the record's shape before writing
671
+ any extract. When the record is an array of rows, `$.field`,
672
+ `$.properties.field` and `$.rows[*].field` all resolve to
673
+ nothing — the processor still reports success and the request
674
+ body ships as `{}`. Address rows as `$[0].field` (that row's
675
+ value, typed) or `$[*].field` (every row: joined with commas
676
+ into a `string` destination; rejected with
677
+ `incompatible_destination_conversion` into a `number`
678
+ destination). Column labels with spaces work as
679
+ `$[*][Order Number]`, `$[*].[Order Number]`, or
680
+ `$[*]['Order Number']`. For one destination element per row
681
+ the two array kinds take different helper forms: a primitive
682
+ array (`stringarray` / `numberarray`) uses `buildArrayHelper:
683
+ [{"extract": "$[*].field"}]`; an `objectarray` uses
684
+ `buildArrayHelper: [{"extract": "$[*]", "mappings": [...]}]`
685
+ with the children addressing the row relatively (`$.field`,
686
+ `{{rows.field}}`). An `extract` placed directly on the
687
+ array-typed field yields nothing. Handlebars
688
+ extracts bind the array record as `rows` (`{{rows.0.field}}`),
689
+ an object record as `record`. The reverse holds too: `$[*]` on
690
+ an object record iterates the object's values, not rows.
660
691
  - |-
661
692
  ## SIZE LIMIT
662
693
  The platform's import save validator caps this field at **1024
@@ -914,7 +945,11 @@ components:
914
945
  (`$.items[*]`), `"$"` (the record root), or omission — a
915
946
  constructed entry (child `mappings` with the extract omitted or
916
947
  `"$"`; the two spellings are equivalent) contributes exactly one
917
- element, and entries append in order. Indexed or comma-joined
948
+ element, and entries append in order. On a grouped (array)
949
+ record the record itself is the array to iterate: `"$[*]"`
950
+ yields one `objectarray` element per row (children address the
951
+ row as `$.field`), and `"$[*].field"` yields one primitive-array
952
+ value per row. Indexed or comma-joined
918
953
  entry extracts (`"$[0]"`, `"$[0],$[0]"`) are not valid: the
919
954
  processor renders the entire destination array as null with no
920
955
  validation error. To emit a fixed number of static elements, add
@@ -935,7 +970,9 @@ components:
935
970
 
936
971
  **For Simple Arrays (stringarray, numberarray, booleanarray)**
937
972
  - Only the 'extract' field is used to pull values
938
- - JSON path with wildcards (e.g., $.items[*].name) returns multiple values
973
+ - JSON path with wildcards (e.g., $.items[*].name) returns multiple values;
974
+ on a grouped (array) record the record itself is the array, so the
975
+ path roots at it ($[*].name — one value per row)
939
976
  - Each result is converted to the appropriate primitive type
940
977
  ```json
941
978
  {
@@ -1037,11 +1074,13 @@ components:
1037
1074
  - When both extract and mappings are provided, the system creates special composite objects
1038
1075
  that maintain hierarchical context during processing
1039
1076
  - This enables accessing both the current array element AND its parent context
1040
- - An ITERATING entry's extract MUST use JSON path syntax starting with '$.'
1041
- (e.g. '$.items[*]'). A CONSTRUCTED entry (child mappings building one element)
1042
- instead omits extract or sets it to exactly "$" — never rewrite "$" into a
1043
- '$.'-prefixed, indexed, or comma-joined form ('$[0]', '$[0],$[0]'): those render
1044
- the entire destination array as null without raising a validation error
1077
+ - An ITERATING entry's extract MUST be a JSON path that iterates an array:
1078
+ '$.items[*]' when the array is a field of an object record, or '$[*]'
1079
+ (objectarray) / '$[*].field' (primitive arrays) when the record itself is a
1080
+ grouped array of rows. A CONSTRUCTED entry (child mappings building one
1081
+ element) instead omits extract or sets it to exactly "$" — never rewrite "$"
1082
+ into an indexed or comma-joined form ('$[0]', '$[0],$[0]'): those render the
1083
+ entire destination array as null without raising a validation error
1045
1084
  - Each array helper entry acts independently, potentially adding multiple elements
1046
1085
 
1047
1086
  The buildArrayHelper is the most complex part of the mappings system - always analyze the
@@ -1455,9 +1494,11 @@ components:
1455
1494
  This field supports THREE DISTINCT PATTERNS that are easily distinguished:
1456
1495
 
1457
1496
  **1. json Path Syntax**
1458
- - MUST start with '$.' prefix
1497
+ - MUST start with '$' — the record root. An object record is addressed as
1498
+ '$.field'; a grouped (array) record as '$[0].field' / '$[*].field'
1459
1499
  - Used for precisely targeting data in structured JSON objects
1460
- - Examples: '$.customer.firstName', '$.items[0].price', '$.addresses[*].street'
1500
+ - Examples: '$.customer.firstName', '$.items[0].price', '$.addresses[*].street',
1501
+ '$[*].Tax' (every row of a grouped record)
1461
1502
  - Wildcards like [*] extract multiple values/objects
1462
1503
 
1463
1504
  ```json
@@ -1468,7 +1509,8 @@ components:
1468
1509
  - Contains '{{' and '}}' pattern
1469
1510
  - Evaluated by the AFE 2.0 handlebars template engine
1470
1511
  - Can include logic, formatting, and computation
1471
- - Access input record fields with {{record.fieldName}} notation
1512
+ - Access input record fields with {{record.fieldName}} notation; a grouped
1513
+ (array) record binds as `rows` instead — {{rows.0.fieldName}} / {{#each rows}}
1472
1514
  - Examples: "{{record.firstName}} {{record.lastName}}", "{{#if record.isActive}}Active{{else}}Inactive{{/if}}"
1473
1515
  - Valid on `object`, `objectarray`, and primitive-array dataTypes as
1474
1516
  well as scalars — the rendered template output must parse into the
@@ -1479,7 +1521,7 @@ components:
1479
1521
  ```
1480
1522
 
1481
1523
  **3. Hard-Coded Value (literal string)**
1482
- - Does NOT start with '$.'
1524
+ - Does NOT start with '$'
1483
1525
  - Does NOT contain handlebars '{{' syntax
1484
1526
  - System treats it as a literal string value
1485
1527
  - VERY COMMON for setting static/constant values
@@ -1501,10 +1543,38 @@ components:
1501
1543
  - The system maintains this context even in deeply nested mappings
1502
1544
  - For object mappings without child mappings, extract should return a complete object
1503
1545
  - When both extract and mappings are defined for objects, extract is applied first
1546
+ - The root is the record as it arrives: an object record roots at `$.field`; a
1547
+ grouped record (an array of rows — grouped exports, file key columns, NetSuite
1548
+ grouped saved searches) roots at the array, so its rows are addressed as
1549
+ `$[0].field` (one row) or `$[*].field` (every row). A root that contradicts the
1550
+ record's shape resolves to nothing without an error.
1504
1551
 
1505
1552
  For most simple field-to-field mappings, prefer JSON path syntax for its clarity and performance.
1506
1553
  For hard-coded values, simply use the literal string as the extract value.
1507
1554
  x-celigo-ai-guidance:
1555
+ - |-
1556
+ ## GROUPED (ARRAY) RECORDS
1557
+ Decide the JSONPath root from the record's shape before writing
1558
+ any extract. When the record is an array of rows, `$.field`,
1559
+ `$.properties.field` and `$.rows[*].field` all resolve to
1560
+ nothing — the processor still reports success and the request
1561
+ body ships as `{}`. Address rows as `$[0].field` (that row's
1562
+ value, typed) or `$[*].field` (every row: joined with commas
1563
+ into a `string` destination; rejected with
1564
+ `incompatible_destination_conversion` into a `number`
1565
+ destination). Column labels with spaces work as
1566
+ `$[*][Order Number]`, `$[*].[Order Number]`, or
1567
+ `$[*]['Order Number']`. For one destination element per row
1568
+ the two array kinds take different helper forms: a primitive
1569
+ array (`stringarray` / `numberarray`) uses `buildArrayHelper:
1570
+ [{"extract": "$[*].field"}]`; an `objectarray` uses
1571
+ `buildArrayHelper: [{"extract": "$[*]", "mappings": [...]}]`
1572
+ with the children addressing the row relatively (`$.field`,
1573
+ `{{rows.field}}`). An `extract` placed directly on the
1574
+ array-typed field yields nothing. Handlebars
1575
+ extracts bind the array record as `rows` (`{{rows.0.field}}`),
1576
+ an object record as `record`. The reverse holds too: `$[*]` on
1577
+ an object record iterates the object's values, not rows.
1508
1578
  - |-
1509
1579
  ## SIZE LIMIT
1510
1580
  The platform's import save validator caps this field at **1024
@@ -1762,7 +1832,11 @@ components:
1762
1832
  (`$.items[*]`), `"$"` (the record root), or omission — a
1763
1833
  constructed entry (child `mappings` with the extract omitted or
1764
1834
  `"$"`; the two spellings are equivalent) contributes exactly one
1765
- element, and entries append in order. Indexed or comma-joined
1835
+ element, and entries append in order. On a grouped (array)
1836
+ record the record itself is the array to iterate: `"$[*]"`
1837
+ yields one `objectarray` element per row (children address the
1838
+ row as `$.field`), and `"$[*].field"` yields one primitive-array
1839
+ value per row. Indexed or comma-joined
1766
1840
  entry extracts (`"$[0]"`, `"$[0],$[0]"`) are not valid: the
1767
1841
  processor renders the entire destination array as null with no
1768
1842
  validation error. To emit a fixed number of static elements, add
@@ -1783,7 +1857,9 @@ components:
1783
1857
 
1784
1858
  **For Simple Arrays (stringarray, numberarray, booleanarray)**
1785
1859
  - Only the 'extract' field is used to pull values
1786
- - JSON path with wildcards (e.g., $.items[*].name) returns multiple values
1860
+ - JSON path with wildcards (e.g., $.items[*].name) returns multiple values;
1861
+ on a grouped (array) record the record itself is the array, so the
1862
+ path roots at it ($[*].name — one value per row)
1787
1863
  - Each result is converted to the appropriate primitive type
1788
1864
  ```json
1789
1865
  {
@@ -1885,11 +1961,13 @@ components:
1885
1961
  - When both extract and mappings are provided, the system creates special composite objects
1886
1962
  that maintain hierarchical context during processing
1887
1963
  - This enables accessing both the current array element AND its parent context
1888
- - An ITERATING entry's extract MUST use JSON path syntax starting with '$.'
1889
- (e.g. '$.items[*]'). A CONSTRUCTED entry (child mappings building one element)
1890
- instead omits extract or sets it to exactly "$" — never rewrite "$" into a
1891
- '$.'-prefixed, indexed, or comma-joined form ('$[0]', '$[0],$[0]'): those render
1892
- the entire destination array as null without raising a validation error
1964
+ - An ITERATING entry's extract MUST be a JSON path that iterates an array:
1965
+ '$.items[*]' when the array is a field of an object record, or '$[*]'
1966
+ (objectarray) / '$[*].field' (primitive arrays) when the record itself is a
1967
+ grouped array of rows. A CONSTRUCTED entry (child mappings building one
1968
+ element) instead omits extract or sets it to exactly "$" — never rewrite "$"
1969
+ into an indexed or comma-joined form ('$[0]', '$[0],$[0]'): those render the
1970
+ entire destination array as null without raising a validation error
1893
1971
  - Each array helper entry acts independently, potentially adding multiple elements
1894
1972
 
1895
1973
  The buildArrayHelper is the most complex part of the mappings system - always analyze the
@@ -2615,6 +2693,16 @@ components:
2615
2693
  x-enumDescriptions:
2616
2694
  create: Builds entirely new output records from inputs, ignoring unmapped fields.
2617
2695
  modify: Makes targeted edits to existing records, preserving unmapped fields.
2696
+ x-celigo-ai-guidance:
2697
+ - |-
2698
+ On a grouped record (the export groups rows, so the record is an
2699
+ array) only `create` can author output — build it from the rows with
2700
+ `$[0].field`, `$[*].field`, or a `buildArrayHelper` over `$[*]`.
2701
+ `modify` has no object to overlay onto an array: the record passes
2702
+ through untouched and the processor reports success. Either mode
2703
+ reshapes the inside of one record; neither changes how many records
2704
+ the page carries (that is the export's `preSavePage` hook) or whether
2705
+ the export groups at all (that is its grouping setting).
2618
2706
  examples:
2619
2707
  - create
2620
2708
  - modify