jlee | 2018-01-05 18:02:09 UTC | #1
I have an output contract property with the name of: "vcg_Organization.description"
When I use the integration in a script it is read as: "vcgOrganization_description" and the results are always undefined
Do I need to escape it or something?
<img src="//inin-prod-use1-developerforum.s3.amazonaws.com/original/1X/5ea202a4128902270a2e84b08724b7f00a81e85a.png" width="446" height="138">
<img src="//inin-prod-use1-developerforum.s3.amazonaws.com/original/1X/92a149031501481ae92a01837992751a71c27d51.png" width="398" height="323">
tim.smith | 2018-01-05 17:34:47 UTC | #2
It's generally a bad practice to use periods in variable names because it causes conflicts with programming languages that use periods as syntax (nearly all languages). This is why they have been escaped for you.
jlee | 2018-01-05 17:57:49 UTC | #3
I feel like I have my schema output contract set up wrong to handle this format:
<img src="//inin-prod-use1-developerforum.s3.amazonaws.com/original/1X/6f988e75c8db791b8446b39fbfdb9bd41a8cffa2.png" width="690" height="115">
the vcg_Organization.name is one example from above. I am sure I just have my output contract wrong for the data I am getting returned.
Here is the flattened data when I run a test from the setup of the action: { "mylphonecallcount": 2, "vcgOrganization.description": "Desc Notes", "statecode": 0, "createdon": "2018-01-04T19:57:58Z", "statuscode": 1, "vcg_Organization.name": "Test Office" }
jlee | 2018-01-05 18:09:00 UTC | #4
Figured it out, my schema was wrong, this fixed it: "vcg_Organization": { "type": "object", "properties": { "name": {"type": "string"}, "description": {"type": "string"} }, "required": ["name"] }
tim.smith | 2018-01-05 18:14:35 UTC | #5
Yep. That's it!
I have an output contract property with the name of: "vcg_Organization.description"
You needed the contract you ended up with because your response does not have a property with that name. It does, however, have a property named vcg_Organization that is an object with a string property named description. The flattening of the response doesn't happen until after your response schema has been applied. The flattening is for the purpose of consumption of the response in architect, not the parsing of the response itself.
system | 2018-02-05 18:24:05 UTC | #6
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: 2311