The field_format configuration applies formatting to field values during automation processing. Unlike action functions (which use vendor_actions / suredone_actions), format functions operate on individual field values as they are read and do not have a search filter -- they apply to every item.
General Structure
"field_format": {
"fieldname": {
"functionName": "argument"
},
"anotherfield": {
"function1": "arg1",
"function2": "arg2"
}
}
Important: The key in field_format is the target (destination) field:
- For imports, this is the key from
field_map (the SureDone field name).
- For exports, this is the value from
field_map (the vendor/source field name).
Multiple format functions can be applied to the same field. They execute in order, top to bottom.
moveDecimal
Move the decimal point to the left by N places. Divides the value by 10^N. Useful for converting values stored as integers (e.g., cents) to decimal form (e.g., dollars).
| Property |
Detail |
| Argument |
Number -- how many places to move the decimal left |
"field_format": {
"price": {
"moveDecimal": 2
}
}
| Before |
After |
1999 |
19.99 |
123456 |
1234.56 |
50 |
0.50 |
With moveDecimal: 4:
| Before |
After |
123456 |
12.3456 |
decimalPlaces
Truncate (round) a value to N decimal places. Uses standard rounding.
| Property |
Detail |
| Argument |
Number -- number of decimal places to keep |
"field_format": {
"price": {
"decimalPlaces": 2
}
}
| Before |
After |
9.5678 |
9.57 |
10.1 |
10.10 |
100 |
100.00 |
abc |
abc (non-numeric values are left unchanged) |
trim
Strip specified characters from both the beginning and end of a field value. Defaults to stripping whitespace when no characters are specified.
| Property |
Detail |
| Argument |
String (optional) -- characters to strip. Empty string or omitted = whitespace. |
"field_format": {
"sku": {
"trim": ""
}
}
| Before |
After |
Characters |
" ABC123 " |
"ABC123" |
(whitespace) |
"--SKU-001--" |
"SKU-001" |
"-" |
"SALE" |
"SALE" |
"*" |
Stripping specific characters:
"field_format": {
"mpn": {
"trim": "#-"
}
}
Strips # and - from both ends of the value.
trimLeft
Strip specified characters from the beginning (left side) only. Defaults to whitespace.
| Property |
Detail |
| Argument |
String (optional) -- characters to strip. Empty string = whitespace. |
"field_format": {
"sku": {
"trimLeft": "0"
}
}
| Before |
After |
"000123" |
"123" |
"00ABC00" |
"ABC00" |
trimRight
Strip specified characters from the end (right side) only. Defaults to whitespace.
| Property |
Detail |
| Argument |
String (optional) -- characters to strip. Empty string = whitespace. |
"field_format": {
"title": {
"trimRight": "."
}
}
| Before |
After |
"Widget..." |
"Widget" |
"...Widget..." |
"...Widget" |
combine
Join the values of multiple fields into the target field using a delimiter. The source fields must be mapped in field_map or field_run.
| Property |
Detail |
| Argument |
Object with fields (array of field names), delimiter (string, default "-"), and ignore_empty (boolean, default false) |
"field_run": {
"MFG": "MFG",
"PartNumber": "PartNumber"
},
"field_format": {
"title": {
"combine": {
"fields": ["MFG", "PartNumber"],
"delimiter": "-"
}
}
}
| MFG |
PartNumber |
Result (title) |
"Acme" |
"12345" |
"Acme-12345" |
"Acme" |
"" |
"Acme-" |
With "ignore_empty": true, empty values are excluded:
| MFG |
PartNumber |
Result (title) |
"Acme" |
"" |
"Acme" |
uppercase
Convert the field value to all uppercase characters.
| Property |
Detail |
| Argument |
Void -- pass an empty string |
"field_format": {
"brand": {
"uppercase": ""
}
}
| Before |
After |
"acme widgets" |
"ACME WIDGETS" |
lowercase
Convert the field value to all lowercase characters.
| Property |
Detail |
| Argument |
Void -- pass an empty string |
"field_format": {
"category": {
"lowercase": ""
}
}
| Before |
After |
"ELECTRONICS" |
"electronics" |
Quick Reference Table
| Function |
Argument |
Description |
Example Input |
Example Output |
moveDecimal |
N (number) |
Move decimal left N places |
1999 (N=2) |
19.99 |
decimalPlaces |
N (number) |
Round to N decimal places |
9.5678 (N=2) |
9.57 |
trim |
"" or "chars" |
Strip from both ends |
" ABC " |
"ABC" |
trimLeft |
"" or "chars" |
Strip from start |
"000123" (chars="0") |
"123" |
trimRight |
"" or "chars" |
Strip from end |
"Widget..." (chars=".") |
"Widget" |
combine |
{"fields": [...], "delimiter": "-"} |
Join fields |
"Acme" + "123" |
"Acme-123" |
uppercase |
"" |
Convert to uppercase |
"hello" |
"HELLO" |
lowercase |
"" |
Convert to lowercase |
"HELLO" |
"hello" |
You can chain multiple format functions on the same field. They execute top to bottom:
"field_format": {
"price": {
"moveDecimal": 2,
"decimalPlaces": 2
},
"sku": {
"trim": "",
"uppercase": ""
}
}
In this example, price first has its decimal moved (1999 becomes 19.99), then is rounded to 2 decimal places. sku is first trimmed of whitespace, then converted to uppercase.