You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit ff60829
Browse filesBrowse the repository at this point in the historyBrowse files
fix(SOL-422): map fields with action-level fieldConfigs
- fieldConfigs replaces inline map_fields fields; map_fields/typecast take dataSource only
- expressions relative to each record, no step prefix
- drop schema inference troubleshooting entry
- lower() replaces unsupported .toLowerCase() in enum matching
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Pass `fields` directly in `map_fields` step parameters rather than action-level `fieldConfigs`. This avoids schema inference issues that cause build failures.
77
+
Declare the field mapping once in the action's `fieldConfigs`. The `map_fields` and `typecast` steps then take only a `dataSource` and apply those `fieldConfigs`.
78
78
79
79
```yaml
80
-
# RECOMMENDED - Inline fields
81
-
- stepId: map_data
82
-
stepFunction:
83
-
functionName: map_fields
84
-
version: '2'
85
-
parameters:
86
-
fields:
87
-
- targetFieldKey: email
88
-
expression: $.email # Direct reference, NO step prefix
89
-
type: string
90
-
dataSource: $.steps.get_data.output.data
80
+
fieldConfigs:
81
+
- targetFieldKey: email
82
+
expression: $.email # Relative to each record, NO step prefix
83
+
type: string
84
+
85
+
steps:
86
+
- stepId: map_data
87
+
stepFunction:
88
+
functionName: map_fields
89
+
version: '2'
90
+
parameters:
91
+
dataSource: $.steps.get_data.output.data
91
92
```
92
93
93
-
### 5. Expression Context Depends on Location
94
+
### 5. Expressions Are Relative to Each Record
94
95
95
-
| Location | Expression Format | Example |
96
-
|----------|------------------|---------|
97
-
| Inline in `parameters.fields` | Direct field reference | `$.email`, `$.work.department` |
`fieldConfigs` expressions are evaluated against each record of the `map_fields` `dataSource`, so reference the record's fields directly: `$.email`, `$.work.department`. Do not prefix them with a step ID.
99
97
100
98
### 6. Never Suggest User-Side Mapping
101
99
@@ -190,52 +188,44 @@ See `references/scope-patterns.md` for detailed patterns.
190
188
191
189
### Step 5: Map Fields to Schema
192
190
193
-
Use inline fields in map_fields parameters:
191
+
Declare the mapping in action-level `fieldConfigs`, then run `map_fields` and `typecast` over the data:
194
192
195
193
```yaml
194
+
fieldConfigs:
195
+
- targetFieldKey: id
196
+
expression: $.id
197
+
type: string
198
+
- targetFieldKey: email
199
+
expression: $.email
200
+
type: string
201
+
- targetFieldKey: department
202
+
expression: $.work.department # Nested field
203
+
type: string
204
+
- targetFieldKey: status
205
+
expression: $.status
206
+
type: enum
207
+
enumMapper:
208
+
matcher:
209
+
- matchExpression: '{{$.status == "Active"}}'
210
+
value: active
211
+
- matchExpression: '{{$.status == "Inactive"}}'
212
+
value: inactive
213
+
- matchExpression: '{{$.status == null}}'
214
+
value: unknown
215
+
196
216
steps:
197
217
- stepId: map_data
198
218
stepFunction:
199
219
functionName: map_fields
200
220
version: '2'
201
221
parameters:
202
-
fields:
203
-
- targetFieldKey: id
204
-
expression: $.id
205
-
type: string
206
-
- targetFieldKey: email
207
-
expression: $.email
208
-
type: string
209
-
- targetFieldKey: department
210
-
expression: $.work.department # Nested field
211
-
type: string
212
-
- targetFieldKey: status
213
-
expression: $.status
214
-
type: enum
215
-
enumMapper:
216
-
matcher:
217
-
- matchExpression: '{{$.status == "Active"}}'
218
-
value: active
219
-
- matchExpression: '{{$.status == "Inactive"}}'
220
-
value: inactive
221
-
- matchExpression: '{{$.status == null}}'
222
-
value: unknown
223
222
dataSource: $.steps.get_data.output.data
224
223
225
224
- stepId: typecast_data
226
225
stepFunction:
227
226
functionName: typecast
228
227
version: '2'
229
228
parameters:
230
-
fields:
231
-
- targetFieldKey: id
232
-
type: string
233
-
- targetFieldKey: email
234
-
type: string
235
-
- targetFieldKey: department
236
-
type: string
237
-
- targetFieldKey: status
238
-
type: enum
239
229
dataSource: $.steps.map_data.output.data
240
230
241
231
result:
@@ -333,7 +323,7 @@ Actions:
333
323
3. **If no skill**: Ask for schema, recommend creating `unified-hris-schema` skill for consistency across HRIS providers
334
324
4. Research BambooHR endpoints: `/v1/employees`, `/v1/employees/directory`, custom reports
335
325
5. Present options with trade-offs (field coverage, scopes, deprecation)
336
-
6. After user selects, implement map_fields with inline fields using schema from skill
326
+
6. After user selects, declare `fieldConfigs` using schema from skill and add map_fields and typecast steps
337
327
7. Configure pagination with cursor support
338
328
8. Test with `--debug`, verify field names match schema
339
329
9. Document coverage
@@ -360,7 +350,7 @@ User says: "My unified connector returns provider field names instead of my sche
360
350
Actions:
361
351
1. Check if `targetFieldKey` uses YOUR schema names (not provider names)
362
352
2. Verify `version: '2'` is specified on map_fields and typecast
363
-
3. Check expression context - inline fields should NOT have step prefix
353
+
3. Check expression context - `fieldConfigs` expressions should NOT have a step prefix
364
354
4. Run with `--debug` to see raw response structure
365
355
5. Verify dataSource path is correct
366
356
@@ -387,20 +377,16 @@ Result: Working pagination with correct cursor handling.
387
377
388
378
### Mapping produces empty results
389
379
**Cause**: Missing `version: '2'` or wrong expression context.
390
-
**Fix**: Add `version: '2'` to map_fields and typecast. For inline fields, use direct references (`$.email`) without step prefix.
380
+
**Fix**: Add `version: '2'` to map_fields and typecast. In `fieldConfigs`, use direct references (`$.email`) without step prefix.
391
381
392
382
### Enum values not translating
393
383
**Cause**: `matchExpression` doesn't match provider values (case-sensitive).
394
-
**Fix**: Check exact provider values with `--debug`. Use `.toLowerCase()` for case-insensitive matching. Always include null/unknown fallback.
384
+
**Fix**: Check exact provider values with `--debug`. Use the `lower()` function for case-insensitive matching (e.g. `'{{lower($.status) == "active"}}'`). Always include null/unknown fallback.
395
385
396
386
### Pagination returns same records
397
387
**Cause**: Cursor not being sent or extracted correctly.
398
388
**Fix**: Verify `iterator.key` matches API's expected parameter name. Check `nextKey` path against raw response. Verify `iterator.in` is correct (query/body/headers).
Copy file name to clipboardExpand all lines: plugins/integrations/stackone-unified-connectors/skills/stackone-unified-connectors/references/field-mapping-patterns.md
+49-57Lines changed: 49 additions & 57 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,34 +13,36 @@
13
13
|`enum`| Constrained values | status (requires enumMapper) |
14
14
|`object`| Nested structure | work_location |
15
15
16
-
## Inline Fields (Recommended Approach)
16
+
## Action-Level fieldConfigs
17
17
18
-
Define fields directly in `map_fields` step parameters:
18
+
Define fields in the action's `fieldConfigs`. The `map_fields` step takes only a `dataSource` and applies them:
19
19
20
20
```yaml
21
-
- stepId: map_data
22
-
stepFunction:
23
-
functionName: map_fields
24
-
version: '2'
25
-
parameters:
26
-
fields:
27
-
- targetFieldKey: email
28
-
expression: $.email # Direct reference, NO step prefix
29
-
type: string
30
-
- targetFieldKey: department
31
-
expression: $.work.department # Nested field reference
32
-
type: string
33
-
dataSource: $.steps.get_data.output.data
21
+
fieldConfigs:
22
+
- targetFieldKey: email
23
+
expression: $.email # Relative to each record, NO step prefix
24
+
type: string
25
+
- targetFieldKey: department
26
+
expression: $.work.department # Nested field reference
27
+
type: string
28
+
29
+
steps:
30
+
- stepId: map_data
31
+
stepFunction:
32
+
functionName: map_fields
33
+
version: '2'
34
+
parameters:
35
+
dataSource: $.steps.get_data.output.data
34
36
```
35
37
36
-
**Why inline?** Action-level `fieldConfigs` can trigger schema inference that adds unwanted properties, causing build failures.
38
+
The field snippets below are entries in `fieldConfigs`.
0 commit comments