scm_pa | 2021-04-30 12:39:59 UTC | #1
I’m looking for some input on a data action issue I’m having. I have a secure data action in a secure flow. It takes 2 inputs, both strings. When I test it in Postman and the data action test UI it succeeds. However in the flow it will take the failure path. During my troubleshooting I have found that it seems to be an issue with the first input. If I hard code a value for it it takes the success path. If I pass in a variable it fails. I used a Set Participant data to log the value of that variable to see if it is getting a valid value and it is. If I take that value and run it through the data action test UI the test succeeds.
At this point the things I have tried are:
- Delete the data action from the flow and add it back in.
- Created a new variable to use.
- Rebuilt the data action into a new one and deleted the old one and added the new one into the flow.
But the results have not changed. I’m going to open a case with Genesys Care but was wondering if anyone has seen something like this before.
Thank you.
Jason_Mathison | 2021-04-30 12:42:35 UTC | #2
Is it possible that input could have tabs, newlines, or quotes in it? That could cause the body template to end up with invalid JSON. You can try wrapping that input with JSON escaping to see if that resolves your problem.
https://help.mypurecloud.com/articles/velocity-macros-data-actions/#jsonString
--Jason
scm_pa | 2021-04-30 13:38:48 UTC | #3
Would the output of set participant data obscure them if they were? This is what the payment id looks like when I query the conversation id.
"attributes": { "IVRATTsEnvVar": "DEV", "IVRATTsPaymentId": "6197872526626017404005",
Thank you
Jason_Mathison | 2021-04-30 14:06:05 UTC | #4
Opening a case with Care seems the most likely path to success, but feel free to post an export of your data action (redacted as needed) in case there is something obviously odd about it.
--Jason
scm_pa | 2021-04-30 14:14:10 UTC | #5
Thanks. I opened a case with care shortly after I first posted this morning. The export is below. { "name": "GET Transaction Details - Exported 2021-04-30 @ 10:10", "integrationType": "custom-rest-actions", "actionType": "custom", "config": { "request": { "requestUrlTemplate": "https://<REDACTED>/v1/ivr?id=$esc.jsonString(${input.id})&runTimeEnv=$esc.jsonString(${input.runTimeEnv})", "requestType": "GET", "headers": {}, "requestTemplate": "${input.rawRequest}" }, "response": { "translationMap": {}, "translationMapDefaults": {}, "successTemplate": "${rawResult}" } }, "contract": { "input": { "inputSchema": { "type": "object", "properties": { "id": { "default": "6194506698256385104002", "type": "string" }, "runtimeEnv": { "default": "DEV", "type": "string" } }, "additionalProperties": true } }, "output": { "successSchema": { "type": "object", "properties": { "paymentInformation": { "type": "object", "properties": { "customer": { "type": "object", "properties": { "customerId": { "type": "string" } }, "additionalProperties": true } }, "additionalProperties": true }, "reconciliationId": { "type": "string" }, "tokenInformation": { "type": "object", "properties": { "customer": { "type": "object", "properties": { "id": { "type": "string" } }, "additionalProperties": true }, "paymentInstrument": { "type": "object", "properties": { "id": { "type": "string" } }, "additionalProperties": true }, "instrumentIdentifier": { "type": "object", "properties": { "id": { "type": "string" } }, "additionalProperties": true } }, "additionalProperties": true } }, "additionalProperties": true } } }, "secure": true }
scm_pa | 2021-04-30 14:14:58 UTC | #6
Almost forgot. I added your escape suggestion to this one. I'm waiting on testing feedback from the customer.
Jason_Mathison | 2021-04-30 14:20:04 UTC | #7
Since the inputs are being used in the URL I would recommend trying $esc.url($input) instead of the JSON escaping tool.
The other thing is that it is unusual to have a body in a GET, so you might change the request template to something like "".
scm_pa | 2021-04-30 14:55:54 UTC | #9
Sorry but still relatively new to some aspects of data actions. Are you saying it should look like: /v1/ivr?id=esc.url({input.id})&runTimeEnv=esc.url({input.runTimeEnv})
Also if I try to set the request template to "" and save it reverts back to its original setting of: { "requestUrlTemplate": "https://<REDACTED>/v1/ivr?id=esc.jsonString({input.id})&runTimeEnv=esc.jsonString({input.runTimeEnv})", "requestType": "GET", "headers": {}, "requestTemplate": "${input.rawRequest}" }
Jason_Mathison | 2021-04-30 18:42:40 UTC | #10
Your latest URL template looks reasonable to me, I would try with that and not worry about the request template. Anything beyond that is going to be up to working with care.
--Jason
system | 2021-05-31 18:51:32 UTC | #11
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: 10783