fransiska.hendra | 2024-10-22 11:19:45 UTC | #1
Hi Everyone,
Just wondering if anyone can help.
I am creating a data action with input contract is string parameter but have "-" (dash) character on it.
Here is request body template
{ "dueDateTime": [$esc.jsonString(${input.DueDateTimes})] }
{ "message": "Processing the Request Body Template resulted in invalid JSON.", "code": "bad.request", "status": 400, "messageParams": {}, "contextId": "0fdf3ab7-afc7-4556-9f7a-7e0a97cfda51", "details": [ { "errorCode": "ACTION.PROCESSING" } ], "errors": [ { "message": "Unexpected character ('-' (code 45)): was expecting comma to separate Array entries\n at [Source: REDACTED (StreamReadFeature.INCLUDE_SOURCE_IN_LOCATION disabled); line: 3, column: 22]", "code": "BAD_REQUEST", "status": 400, "messageParams": {}, "details": [], "errors": [] } ] }
Just wondering if anyone can help to advise this ?
Thank you for help in advance.
Fransiska
Zino_Onokpise | 2024-10-25 20:18:44 UTC | #2
Hi @fransiska.hendra
For tips on configuring GC products, your question is best suited for GC Community Forum
Jason_Mathison | 2024-11-01 18:11:13 UTC | #3
The issue is that you are not wrapping your time in quotes, so the 2024 at the start of your DueDateTimes is considered a number, but that fails when it gets to the first -.
Assuming you only have one value to put into the array, this might work for you.
{
"dueDateTime": ["$esc.jsonString(${input.DueDateTimes})"]
}
--Jason
system | 2024-12-02 18:11:17 UTC | #4
This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.
This post was migrated from the old Developer Forum.
ref: 29995