Data Action Input Contract as array with "-" character

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.

image

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

Hi @fransiska.hendra

For tips on configuring GC products, your question is best suited for GC Community Forum

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

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.