Data Acition Fails in Architect

The atteched Data Action works fine when testing within the Actions Container but is failing in architect. Can you take a look at provide your thoughts.

{
"name": "QA Get WW Canceled Meetings By ZipCode - Exported 2018-10-03 @ 16:06",
"integrationType": "custom-rest-actions",
"actionType": "custom",
"config": {
"request": {
"requestUrlTemplate": "https://voice-genesys-app.qat2.voicenonprod.us-east-1.aws.wwiops.io/api/v1/meetings/{input.ZipCode}/cancels", "requestType": "GET", "headers": { "UserAgent": "PureCloudIntegrations/1.0", "Content-Type": "application/x-www-form-urlencoded" }, "requestTemplate": "{input.rawRequest}"
},
"response": {
"translationMap": {},
"translationMapDefaults": {},
"successTemplate": "{ "meetings" : ${rawResult} }"
}
},
"contract": {
"input": {
"inputSchema": {
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Meeting Cancelation Finder",
"description": "Search Canceled Meetings by ZipCode",
"type": "object",
"required": [
"ZipCode"
],
"properties": {
"ZipCode": {
"type": "string",
"description": "The ZipCode."
}
}
}
},
"output": {
"successSchema": {
"schema": "http://json-schema.org/draft-07/schema#", "title": "The Root", "type": "object", "required": [ "meetings" ], "properties": { "meetings": { "type": "array", "items": { "type": "object", "title": "The Items ", "properties": { "id": { "type": "integer", "title": "The Id ", "default": 0 }, "wwiId": { "type": "integer", "title": "The Wwiid ", "default": 0 }, "name": { "type": "string", "title": "The Name ", "default": "", "pattern": "^(.*)"
},
"directions": {
"type": "string",
"title": "The Directions ",
"default": "",
"pattern": "^(.)" }, "address1": { "type": "string", "title": "The Address1 ", "default": "", "pattern": "^(.*)"
},
"address2": {
"type": "string",
"title": "The Address2 ",
"default": "",
"pattern": "^(.
)" }, "city": { "type": "string", "title": "The City ", "default": "", "pattern": "^(.*)"
},
"citySlug": {
"type": "string",
"title": "The Cityslug ",
"default": "",
"pattern": "^(.)" }, "customerAddressId": { "type": "string", "title": "The Customeraddressid ", "default": "", "pattern": "^(.*)"
},
"state": {
"type": "string",
"title": "The State ",
"default": "",
"pattern": "^(.
)" }, "stateName": { "type": "string", "title": "The Statename ", "default": "", "pattern": "^(.*)"
},
"stateNameSlug": {
"type": "string",
"title": "The Statenameslug ",
"default": "",
"pattern": "^(.)" }, "zipCode": { "type": "string", "title": "The Zipcode ", "default": "", "pattern": "^(.*)"
},
"country": {
"type": "string",
"title": "The Country ",
"default": "",
"pattern": "^(.
)" }, "cancels": { "type": "array", "title": "The Cancels ", "items": { "type": "object", "title": "The Items ", "required": [ "meetingInstanceId", "date", "time", "weekday" ], "properties": { "meetingInstanceId": { "type": "integer", "title": "The Meetinginstanceid ", "default": 0 }, "date": { "type": "string", "title": "The Date ", "default": "", "pattern": "^(.*)"
},
"time": {
"type": "string",
"title": "The Time ",
"default": "",
"pattern": "^(.*)" }, "weekday": { "type": "string", "title": "The Weekday ", "default": "", "pattern": "^(.*)"
}
}
}
}
}
}
}
}
}
}
},
"secure": false
}

Hi Agilio,

It looks like you exported your action and then copy and pasted it into your question. You should be able to attach the file instead, which would avoid the forum software from causing problems when it formats it.

When I tried to run this in test mode I ran into all kinds of schema problems. Can you give me the correlation ID of an example of where your test passed? Also, when you say that it fails in designer do you mean it takes the failure path or something else?

--Jason

The schema problems that I see seem to be around having a "pattern" set for many of the items in the array. You are using the pattern ^(.)$ many times. That regex will only find a match (capture) if the string is a single character. Since these strings are more than a single character long the regex is not returning a result, causing the schema validation to fail.

If your goal is to capture the whole string then you do not need to include a "pattern" at all. If you are trying to grab a specific part of each string I recommend using an online regex tester to work through your regex expression.

--Jason

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