n8n DyanoDB node’s Field Value is treating the sent property as a Number even if it’s a String if it only contains numbers.
Input schema:
idA: String
idB: String
Sample input:
{
"idA": "2415", // clearly a string
"idB": "testid" // also a string
}
On DyanoDB node
These are working:
Field Id: id, Field Value: {{ $json.idB }}
Field Id: id, Field Value: testid
Field Id: id, Field Value: Test {{ $json.idA }}
Field Id: id, Field Value: "{{ $json.idA }}"
These wield yield an error:
Field Id: id, Field Value: {{ $json.idA }}
Field Id: id, Field Value: {{ $json.idA.toString() }}
Field Id: id, Field Value: {{ $json.id.trim() }}
Field Id: id, Field Value: {{ String($json.idA) }}
Field Id: id, Field Value: {{ `${$json.idA}` }}
Field Id: id, Field Value: 2415
Is there a way to prevent n8n from doing an automatic type coercion for String with purely numeric characters? My id field in dynamo db needs to accept a string only.
The (Key - Type - Value) fields exists for GET and DELETE. But the CREATE or UPDATE only has (Field Item - Field Value) fields, with no way to force set a type.
I already tried the following, but they are still coerced into a number by the node itself before sending to DynamoDB, which throws an error:
// Given idA = 2415 // Number
Field Id: id, Field Value: {{ $json.idA }}
Field Id: id, Field Value: {{ $json.idA.toString() }}
Field Id: id, Field Value: {{ $json.id.trim() }}
Field Id: id, Field Value: {{ String($json.idA) }}
Field Id: id, Field Value: {{ `${$json.idA}` }}
Field Id: id, Field Value: 2415